Access an API for embedding Corti Assistant in your workflow today
The Corti Embedded Assistant API enables seamless integration of Corti Assistant into host applications, such as Electronic Health Record (EHR) systems, web-based clinical portals, or native applications using embedded WebViews. The implementation provides a robust, consistent, and secure interface for parent applications to control and interact with embedded Corti Assistant.
The details outlined below are for you to embed the Corti Assistant “AI scribe solution” natively within your application. To lean more about the full Corti API, please see more here
This implementation provides a robust, consistent, and secure interface for parent applications to control and interact with the embedded Corti Assistant. The API supports both asynchronous (postMessage) and synchronous (window object) integration modes.
// Wait for the embedded app to be readywindow.addEventListener('message', async (event) => { if (event.data?.type === 'CORTI_EMBEDDED_EVENT' && event.data.event === 'ready') { // Use the window API directly const api = window.CortiEmbedded.v1; const user = await api.auth({ mode: 'stateful', accessToken: 'your-access-token', refreshToken: 'your-refresh-token' }); console.log('Authenticated user:', user); }});
iframe.contentWindow.postMessage({ type: 'CORTI_EMBEDDED', version: 'v1', action: 'auth', requestId: 'unique-id', payload: { mode: 'stateless' | 'stateful', // we currently do not take this value into account and will always refresh the token internally access_token: string, refresh_token?: string, id_token?: string, expires_in?: number, token_type?: string }}, '*');
Visit /embedded-demo to see a working integration example with interactive controls. To authenticate - grab the full auth response from sessionStorage and paste it into the input field. The rest of the actions use static data for the messages to create resources i.e. interaction, facts.
This is also used for manual testing/validation/development
Use the embedded-demo page for manual testing. There’s some utility methods set up for potential e2e test, but this is not configured yet, as it also expects a full auth-response that is inserted manually. We could potentially use this page later for e2e testing.
Copy
Ask AI
import { EmbeddedAPITester, runIntegrationTest } from './utils';const tester = new EmbeddedAPITester('/embedded');await tester.loadEmbeddedFrame(container);await runIntegrationTest(tester); // TODO