Installation
Install the Corti Embedded Web package:Authentication
Before using the Web Component API, authenticate your users using OAuth2. See the Authentication Guide for complete setup instructions including Authorization Code Flow with PKCE (recommended), obtaining tokens, and handling token refresh.All Embedded Assistant integrations require user-based OAuth2 authentication.
Client credentials and machine-to-machine flows are not supported.
Usage
The Web Component works with any modern framework (React, Vue, Angular, Svelte, etc.) since it’s based on standard Web Components. We provide dedicated React wrappers for enhanced developer experience, while other frameworks can use the raw HTML element with small framework-specific wrappers if needed.Vanilla TypeScript/JavaScript
This approach works universally - use it directly or wrap it in framework-specific components for Vue, Angular, or other frameworks.Full working example: See the complete vanilla TypeScript
example
with authentication, interaction creation, and event handling.
querySelector):
React (Built-in Support)
For React, we provide dedicated components and hooks for the best developer experience. For other frameworks like Vue or Angular, use the vanilla approach above and create small framework-specific wrappers as needed.Full working example: See the complete React
example
with authentication, interaction creation, and event handling.
In React, use the
baseURL prop. In plain HTML, use the baseurl
attribute. Both map to the same underlying component property.Component Properties
baseURL (required)
The base URL of the Corti Assistant instance. Choose the appropriate region:
- EU:
https://assistant.eu.corti.app - EU MD:
https://assistantmd.eu.corti.app(medical device compliant) - US:
https://assistant.us.corti.app
visibility (optional)
Controls the initial visibility of the embedded assistant:
"visible"(default): Assistant is visible on mount"hidden": Assistant is hidden on mount
API Methods
All API methods are available through the element reference (vanilla) or via theuseCortiEmbeddedApi hook (React).
Shared API SurfaceThe Web Component provides the same operations documented in the API Reference. Web Component, Window API, and PostMessage expose the same capabilities, but their invocation shapes differ.This page focuses on the package API exposed by the Web Component and React wrapper. For Window API and PostMessage-specific call shapes, see the API Reference.
Core Methods
auth(credentials)- Authenticate the user sessionconfigure(config)- Configure interface features and appearancecreateInteraction(interaction)- Create a new clinical interactionnavigate(path)- Navigate to a specific routestartRecording()- Start audio recordingstopRecording()- Stop audio recordinggetStatus()- Get current session statusconfigureSession(config)- Configure session-specific settingsgetTemplates()- Retrieve available document templatesaddFacts(factsArray)- Add clinical facts to the current interactionsetCredentials(credentials)- Update authentication credentials
Events
The Web Component emits events for all Assistant activities. Listen for events using standard event listeners.Ready Event
Emitted when the Assistant is fully loaded and ready to receive API calls:Other named events
You can listen for all other named events directly by listening for them as above. For example, therecording.started event (as detailed here):
Error Event
Emitted when an API call fails or an error occurs:Generic Event
You can also listen for all events, regardless of type, by simply listening for"event" as per below:
End-User Authentication
Before using most API methods, you must authenticate with valid OAuth2 tokens. The Web Component expects tokens from an OAuth2 authentication flow. See the Authentication Guide for detailed information on obtaining tokens.Configuration
Configure the Assistant interface after authentication:Full Working Examples
Complete, runnable examples are available in the Corti Examples Repository:Vanilla TypeScript Example
Demonstrates
<corti-embedded> web component usage with vanilla TypeScript, including authentication, interaction creation, navigation, and event handling.React Example
Demonstrates
CortiEmbeddedReact component and useCortiEmbeddedApi hook usage with React, including authentication, interaction creation, navigation, and event handling.TypeScript Support
The package includes full TypeScript definitions:Next Steps
Integration Comparison
Compare all three integration methods and choose the right one for your architecture
Authentication Setup
Set up OAuth2 authentication for your users
API Reference
Complete API documentation for all methods
Configuration Guide
Customize the Assistant interface and behavior