Skip to main content
Use configureApp() for app-level configuration such as UI visibility, AI Chat Experts, companion app access, patient consent, appearance, locale, and network settings.
debug enables a debug panel intended for development only. Do not enable it in staging or production.
Applies to Web Component, Window API, and PostMessage. Examples on this page use the Web Component API shape.
configureApp() is patchable and may be called multiple times.
Use Configuration Scenarios for practical examples and Supported Values for supported languages and override keys.

Payload shape

Usage

AI Chat agent configuration

By default, AI Chat uses the Corti Assistant agent to answer clinical questions, read the active interaction’s facts, transcript, and documents, and propose document edits for user approval. Set aiChat.agent to an agent definition to add a custom Expert. Corti Assistant creates this agent when the user sends the first message in a new conversation and delegates relevant requests to it. Corti Assistant retains its own instructions, interaction tools, and document editing workflow. The custom agent’s systemPrompt applies to the Expert. The definition uses the request-body fields from Create an agent, with the restrictions below. Pass the definition itself, rather than an existing agent ID or a create-agent response.

Agent definition fields

EmbeddedAgentDefinition accepts these fields. Unrecognized fields are rejected. For connector fields, see Create an agent. See I want to add a custom Expert to AI Chat for a configuration example and verification steps.

MCP connector authentication

An MCP connector’s optional auth object accepts only a type field: AI Chat cannot collect separate connector credentials or complete authentication challenges. configureApp() rejects bearer, apiKey, and oauth2, along with ref, scope, tokenUrl, requiredHeaders, and optionalHeaders. These restrictions also apply when copying an agent definition from the Corti Console.

Updating or clearing the definition

Changing or clearing the definition starts a new conversation the next time AI Chat renders. Messages from the previous conversation are not carried over.

When AI Chat is disabled

ui.aiChat controls whether AI Chat is shown. aiChat.agent configures the custom Expert. Supplying a definition does not enable AI Chat or grant access to it. When ui.aiChat is false, the definition is still validated and stored, but the custom Expert is not used. Setting ui.aiChat to true later uses the stored definition, provided AI Chat is available to the user. These settings apply only to embedded Corti Assistant.

Validation and access errors

Configuration validates the definition’s shape. An invalid definition rejects configureApp() with INVALID_PAYLOAD, including when AI Chat is disabled. Examples include an empty name, an unsupported connector type or authentication setting, a non-HTTP connector URL, or an existing agent ID supplied instead of a definition. A successful configuration does not verify model availability, connector availability, or permission to create agents. Agent creation uses the authenticated user’s credentials when the user first sends a message. If custom Expert creation fails, AI Chat continues with the default agent. It displays “The custom expert is unavailable. You can still use AI Chat.” and removes the custom Expert from Sources for that conversation. The default agent retains its interaction tools and document editing workflow. Correct the definition or permissions before starting a new conversation. Changing aiChat.agent starts a new conversation; setting it to null removes the custom Expert. Failure to create the default agent still displays an error. The fallback covers custom Expert creation only. It does not handle connector authentication or tool failures after the Expert has been created. Set consent.enabled to true to require users to confirm patient consent before an in-person recording starts or resumes. Consent is stored per interaction, so users confirm it once per interaction. Consent is disabled by default. If the user declines, recording does not start and startRecording() rejects with FORBIDDEN. See I want users to confirm patient consent before recording for an example.
TypeScript integrations using the Web Component or React need @corti/embedded-web@2.1.0 or later for the consent types in configureApp().

Prerequisites

  • None

Input validation

  • debug, ui.interactionTitle, ui.aiChat, ui.documentFeedback, ui.navigation, companionApp.enabled, and consent.enabled: Must be boolean values when provided.
  • aiChat.agent: Must be a valid agent definition or null when provided. An existing agent ID is not supported.
  • appearance.primaryColor: Must be a valid CSS color string or null when provided.
  • locale.interfaceLanguage: Must be a supported interface language when provided.
  • locale.dictationLanguage: Must be a supported dictation language or null when provided.
  • locale.overrides: Keys must match known override strings.
  • network.websocketBaseUrl: Must be a valid WebSocket URL or null when provided. This is mainly for proxy deployments. See the Proxy guide.

Possible errors

  • INVALID_PAYLOAD: Invalid agent definition, color, URL, language code, or non-boolean UI value.
  • INTERNAL_ERROR: Failed to apply configuration.

Returns

This method is documented as a configuration action and does not expose a response payload in the current public reference.