Integration Architecture
When you embed Corti Assistant, you’re integrating a complete application into your own. This embedded Assistant communicates with your application through one of three integration methods: Your integration layer handles:- Authentication - Managing user sessions with OAuth2 tokens
- API Communication - Creating interactions, generating documents, controlling recording
- Event Handling - Receiving updates about interactions, documents, and user actions
- UI Embedding - Displaying the Assistant interface in your application
Three Integration Methods
Corti provides three ways to embed the Assistant, each optimized for different architectural needs:Quick Decision Guide
Comparison Table
Choose your integration method based on your architectural requirements:| Web Component | PostMessage | Window API | |
|---|---|---|---|
| Recommended For | Native apps (C#) + WebView, web apps | Existing postMessage implementations | Same-origin / direct URL embedding |
| Native App Support | ✅ Yes (C#, .NET, Electron via WebView) | ✅ Yes (via WebView) | ⚠️ Same-origin only |
| Framework Support | Universal (React, Vue, Angular…) | Universal | Universal (same-origin only) |
| Cross-Origin Support | ✅ Yes | ✅ Yes | ❌ No (same-origin only) |
| Type Safety | Full TypeScript | Manual typing required | Full TypeScript |
| API Style | Promise-based methods | postMessage request/response | Promise-based methods |
| Event Handling | Native addEventListener | Manual postMessage parsing | Native addEventListener |
| Ease of Use | 5/5 | 3/5 | 4/5 |
| React Support | Built-in hooks & components | Manual implementation | Manual implementation |
| Setup Complexity | Install NPM package | Create iframe + message handlers | Load script + direct API access |
| iframe Management | Automatic | Manual | Manual (if using iframe) |
Web Component (Recommended)
- Web applications - React, Vue, Angular, or any framework (including server-rendered pages)
- Native applications - C#, .NET, Electron with WebView controls loading a local HTML page
- Native desktop applications (C#, .NET, Electron) with WebView controls
- Web applications using React, Vue, Angular, or any modern framework
- Mobile applications with WebView components
- New integrations starting from scratch
- Teams that want TypeScript support and native event handling
- Cross-origin scenarios (different domains)
- Standard Web Component that works everywhere
- Built-in React hooks and components for optimal DX
- Automatic iframe communication handling
- Promise-based API with TypeScript definitions
Web Component Integration Guide
Learn how to integrate using the Web Component API
PostMessage API
- Existing implementations already using postMessage
- Teams with specific iframe management requirements
- Legacy applications where adding new dependencies is difficult
- Full control over iframe lifecycle and positioning
- Direct access to postMessage protocol
- Works cross-origin (different domains)
- Requires manual event parsing and error handling
PostMessage Integration Guide
Learn how to integrate using the PostMessage API
Window API
window.CortiEmbedded object.
Best for:
- Same-origin scenarios (both apps on same domain)
- Direct URL embedding in webviews or popup windows
- Mobile webview integrations where same-origin is guaranteed
- Scenarios requiring the simplest possible integration
- No iframe or postMessage complexity
- Direct function calls to JavaScript API
- Only works when same-origin policy is satisfied
- Promise-based API with full TypeScript support
Window API Integration Guide
Learn how to integrate using the Window API
Common Integration Flow
Regardless of which method you choose, the integration follows the same high-level flow:Embed the Assistant
Add the Corti Assistant interface to your application using your chosen integration method (Web Component, iframe, or window reference).
Authenticate Users
Implement OAuth2 authentication to obtain user tokens. All methods require
user-based authentication with OAuth2 tokens (access, refresh, and ID tokens).
Authentication Guide
Learn how to set up OAuth2 authentication for your users
Initialize the Assistant
Pass authentication tokens to the Assistant and configure the interface
(features, appearance, locale).
Create Clinical Interactions
Use the API to create interactions that represent clinical encounters,
associate them with patient data, and manage their lifecycle.
Authentication Requirements
All three integration methods require OAuth2 user authentication. See the Authentication Guide for complete setup instructions.All Embedded Assistant integrations require user-based OAuth2 authentication
with
access_token, refresh_token, and id_token. Client credentials and
machine-to-machine flows are not supported.API Capabilities
Once embedded and authenticated, all three integration methods provide access to the same comprehensive API:Session Management
Session Management
- Authenticate users with OAuth2 tokens
- Refresh authentication tokens
- Configure interface features and appearance
- Set language and locale preferences
Clinical Interactions
Clinical Interactions
- Create new clinical interactions - Associate encounters with patient context
- Manage interaction lifecycle - Navigate between sessions
Audio & Recording
Audio & Recording
- Start and stop audio recording - Control recording state - Monitor recording status - Handle recording events
Document Generation
Document Generation
- Add clinical facts to interactions - Generate documents from captured data - Retrieve available templates - Configure document generation behavior
Event Monitoring
Event Monitoring
- Listen for interaction events
- Monitor document generation status
- Track recording state changes
- Handle errors and warnings
Complete API Reference
Full documentation of all API methods, parameters, and return types
Next Steps
Choose Web Component
Modern, recommended approach with framework support
Choose PostMessage
Direct iframe control with manual postMessage handling
Choose Window API
Same-origin integration with direct API access
View Working Examples
Complete TypeScript and React examples on GitHub