@corti/ambient-web package provides a set of custom elements that handle microphone management, audio streaming, transcript delivery, and facts on top of the Corti API. It works with any frontend framework or plain HTML.
Package: @corti/ambient-web on npm | Examples: corti-examples/ambient
<corti-ambient>— opinionated, all-in-one component with built-in UI (recommended for most use cases)- Modular components — individual building blocks (
<ambient-root>,<ambient-recording-button>, etc.) for fully custom layouts
OAuth 2.0 authentication is not handled by this library. The client must provide an authorization token or token refresh function while using the component. Each ambient session also requires an
interactionId.Installation
Module import
Quick start
Configuration
SetambientConfig as a JavaScript property to configure the stream. The type matches the StreamConfig from the Streams WebSocket API.
When using mode.type: "facts", you must also set mode.outputLocale (the language for extracted facts).
interactionId property is required — it identifies the session for the Streams API.
See the Streams API Reference for the full configuration schema.
Modular components
For custom UI layouts, use individual components inside an<ambient-root> parent:
See the API Reference for full per-component property and method tables.
Virtual mode
Virtual mode captures tab/window/app audio mixed with microphone input. Enable it via thevirtualMode attribute or property, or let users toggle it from the settings menu when settingsEnabled includes "virtualMode" (included by default on <corti-ambient>).
Keyboard shortcuts
The component supports two keybinding modes:
Configure via attributes:
event.key names (e.g. "Space", "k", "Meta") or event.code values (e.g. "KeyK", "Backquote"). Modifier combinations are not supported.
When both keybindings are set to the same key, toggle-to-talk takes priority.
Preventing keybinding activation
Use thekeybinding-activated event to conditionally block keybindings:
Attribute formatting
Resources
- npm package — latest version and install info
- Examples — integration examples
- API Reference — properties, methods, and events for every component
- Authentication Guide — access tokens and automatic refresh
- Proxy Guide — route WebSocket traffic through your own server
- Styling Guide — CSS custom properties and theming
- Streams API Reference — underlying WebSocket API specification
For support or questions, reach out through help.corti.app