@convai/web-sdk 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,10 +15,10 @@ TypeScript-first SDK for embedding Convai AI characters into React and vanilla J
15
15
  > **Breaking for 1.8.0 users:** the `<convai-chat>` custom element and the `./embed/browser` entry point (`dist/embed/chat-embed-v1.js`) are removed. The copy/paste published-chat embed is now `<convai-widget>` from [`@convai/web-widget`](https://www.npmjs.com/package/@convai/web-widget); the [CHANGELOG](./CHANGELOG.md) has the before/after snippet.
16
16
 
17
17
  - **Multi-character rooms** — connect a roster of characters with the `characters` config option (two copies of one character are two independent members), switch who answers with `setInteractionTarget()`, add or remove members live with `updateCharacterRoster()`, and let other participants join the same room with `joinRoom()`. Every transcript line, audio track and readiness event is attributed to a `membershipId`. [Usage below.](#multi-character-rooms-beta)
18
- - **Typed events** — `client.on(event, callback)` infers each callback's payload from the exported `ConvaiEventMap`, so `botReady`, `modelOutput`, `characterStatus` and the rest are checked at compile time. See the [events reference](docs/convai_events.md).
18
+ - **Typed events** — `client.on(event, callback)` infers each callback's payload from the exported `ConvaiEventMap`, so `botReady`, `modelOutput`, `characterStatus` and the rest are checked at compile time. See the [events reference](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/event-reference).
19
19
  - **Local transcript lines and usage updates** — `appendMessage()` inserts a line into the transcript without sending anything, and `toggleUsageUpdates(true)` opts into per-turn `usageUpdate` cost breakdowns (on a session connected with `debug: true`; otherwise the server has no usage stream).
20
20
  - **Character versioning** — connect to a character's editable draft, its promoted latest release, or an immutable tag with the `characterVersion` config option, and list, compare, release, promote, fork and discard versions through `client.characterVersions`. [Usage below.](#character-versioning-beta)
21
- - **SSE interaction transport** — chat over the interaction API, selected by `interactionApiUrl`: text in, the reply streamed as text and, with `ttsEnabled`, as speech (`audioData`); the one transport that runs under Node. We recommend SSE for chat and realtime for voice — see [Choosing a Transport](docs/convai_choosing_transport.md). [Usage below.](#sse-interaction-transport-beta)
21
+ - **SSE interaction transport** — chat over the interaction API, selected by `interactionApiUrl`: text in, the reply streamed as text and, with `ttsEnabled`, as speech (`audioData`); the one transport that runs under Node. We recommend SSE for chat and realtime for voice — see [Choosing a Transport](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/choose-a-transport). [Usage below.](#sse-interaction-transport-beta)
22
22
  - **Embeddable vanilla widget** — the vanilla widget runs inside a shadow root, with a character header and a connecting overlay, so it can be dropped into any page.
23
23
  - **Node-importable dist** — `@convai/web-sdk/core`, `/vanilla`, `/vanilla/websocket` and `/lipsync-helpers` load in plain Node, SSR and Next.js server components.
24
24
  - **Character voice mute** — `setCharacterMuted()` / `isCharacterMuted()` silence the character's voice for the listener; `audioControls` stays the microphone.
@@ -34,7 +34,7 @@ TypeScript-first SDK for embedding Convai AI characters into React and vanilla J
34
34
  connection, so a half-upgraded backend fails at connect rather than
35
35
  mid-conversation. Omit the block entirely and nothing changes: existing
36
36
  connections and one-argument text messages stay on the v1 wire contract.
37
- [Options table.](./docs/convai_configuration.md#protocol-capabilities)
37
+ [Options table.](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/actions)
38
38
  - **Correlated action results and logical turns** — action results carry the
39
39
  call they answer, and turn correlation holds across multi-envelope and
40
40
  voice turns, so a response can be tied to its cause without guessing from
@@ -137,7 +137,7 @@ window.addEventListener("beforeunload", () => {
137
137
 
138
138
  ### Published text chat
139
139
 
140
- See the [Published text chat guide](./docs/convai_published_chat.md) for
140
+ See the [Published text chat guide](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/published-text-chat) for
141
141
  React and vanilla integrations, lifecycle behavior, and the complete API
142
142
  reference.
143
143
 
@@ -170,10 +170,11 @@ session. An application performing its own retry may pass the same
170
170
  text-only; the server-issued room token does not permit publishing microphone
171
171
  or camera tracks.
172
172
 
173
- The `@convai/web-sdk/embed` browser element creates its own per-browser
174
- requester identifier. If a server or SSR integration calls its published-chat
175
- grant helpers directly, it must pass a caller-scoped requester identifier; do
176
- not reuse a process-wide identifier across visitors.
173
+ In a browser, the `@convai/web-sdk/embed` grant helper
174
+ (`requestPublishedChatGrant`) creates its own per-browser requester identifier.
175
+ If a server or SSR integration calls the published-chat grant helpers directly,
176
+ it must pass a caller-scoped requester identifier; do not reuse a process-wide
177
+ identifier across visitors.
177
178
 
178
179
  When using `ConvaiWidget`, provide `requestPublicationGrant` so Reset,
179
180
  Disconnect, and later reopen operations mint a new grant instead of attempting
@@ -247,27 +248,28 @@ Full documentation is at **<a href="https://docs.convai.com/api-docs/plugins-and
247
248
 
248
249
  | Guide | Description |
249
250
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
250
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">Quick Start</a> | First working integration in under 5 minutes |
251
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">Configuration</a> | All `ConvaiConfig` options |
252
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">React Integration</a> | `useConvaiClient`, `ConvaiWidget`, and React-specific patterns |
253
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">Vanilla JS</a> | `ConvaiClient`, `createConvaiWidget`, and audio setup |
251
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/quickstart" target="_blank" rel="noopener noreferrer">Quick Start</a> | First working integration in under 5 minutes |
252
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/vanilla-typescript/best-practices-and-type-definitions" target="_blank" rel="noopener noreferrer">Configuration</a> | All `ConvaiConfig` options |
253
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/react" target="_blank" rel="noopener noreferrer">React Integration</a> | `useConvaiClient`, `ConvaiWidget`, and React-specific patterns |
254
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/vanilla-typescript" target="_blank" rel="noopener noreferrer">Vanilla JS</a> | `ConvaiClient`, `createConvaiWidget`, and audio setup |
254
255
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/event-reference" target="_blank" rel="noopener noreferrer">Events</a> | Full event reference — `botReady`, `stateChange`, `messagesChange`, `interactionCreated`, and more |
255
256
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/dynamic-context" target="_blank" rel="noopener noreferrer">Context Management</a> | Dynamic context, `updateContext`, file upload, session management |
256
257
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/emotions" target="_blank" rel="noopener noreferrer">Emotions</a> | Per-turn emotion detection, provider options, and `stateOfMind` / `updateEmotion()` |
257
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">Lipsync</a> | ARKit / MetaHuman blendshape streams and `BlendshapeQueue` API |
258
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/lipsync-and-blendshape" target="_blank" rel="noopener noreferrer">Lipsync</a> | ARKit / MetaHuman blendshape streams and `BlendshapeQueue` API |
258
259
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/actions" target="_blank" rel="noopener noreferrer">Actions</a> | Trigger character behaviors and scene actions |
259
260
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/long-term-memory" target="_blank" rel="noopener noreferrer">Memory</a> | Long-term memory scoped to end users |
260
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">Audio & Video</a> | Microphone, camera, screen share controls |
261
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/react" target="_blank" rel="noopener noreferrer">Audio & Video</a> | Microphone, camera, screen share controls |
261
262
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/error-handling" target="_blank" rel="noopener noreferrer">Error Handling</a> | `error`, `disconnect`, `serverResponse`, retry patterns |
262
263
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/auth-tokens" target="_blank" rel="noopener noreferrer">Auth Tokens</a> | Server-side token exchange for production |
263
264
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/websocket-transport-layer" target="_blank" rel="noopener noreferrer">WebSocket Transport</a> | Alternative transport for WebRTC-constrained environments |
264
- | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">SSE Transport</a> | Chat transport: text in, text or audio out; the one that runs under Node |
265
- | [Choosing a Transport](docs/convai_choosing_transport.md) | SSE vs realtime vs WebSocket, the recommended SSE-chat-plus-voice-mode setup, and why |
266
- | [Character Versioning](docs/convai_character_versioning.md) | Connect to a draft, latest, or tagged version; list, compare, release and promote versions |
267
- | [Multi-Character Rooms](docs/convai_multi_character.md) | Rosters, `joinRoom`, interaction targets, live roster updates, per-member attribution |
268
- | [Published Text Chat](docs/convai_published_chat.md) | Grant-based text-only sessions, the copy/paste embed, lifecycle and API reference |
269
- | [Link Previews](docs/convai_link_previews.md) | Rendering links the character sends: previews, custom chat UIs, the scheme allowlist |
270
- | [Events Reference (local)](docs/convai_events.md) | Every event with its typed payload, including the v2 and multi-character events |
265
+ | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/sse-transport" target="_blank" rel="noopener noreferrer">SSE Transport</a> | Chat transport: text in, text or audio out; the one that runs under Node |
266
+ | [Choosing a Transport](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/choose-a-transport) | SSE vs realtime vs WebSocket, the recommended SSE-chat-plus-voice-mode setup, and why |
267
+ | [Character Versioning](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/character-versioning) | Connect to a draft, latest, or tagged version; list, compare, release and promote versions |
268
+ | [Multi-Character Rooms](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/multi-character-rooms) | Rosters, `joinRoom`, interaction targets, live roster updates, per-member attribution |
269
+ | [Published Text Chat](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/published-text-chat) | Grant-based text-only sessions, the copy/paste embed, lifecycle and API reference |
270
+ | [Link Previews](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/link-previews) | Rendering links the character sends: previews, custom chat UIs, the scheme allowlist |
271
+ | [Mute the Character's Voice](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/mute-the-characters-voice) | `setCharacterMuted` / `isCharacterMuted`: silence the character for the listener |
272
+ | [Raw Transport Messages](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/raw-messages) | The typed `rawMessage` event across LiveKit, WebSocket and SSE |
271
273
 
272
274
  ---
273
275
 
@@ -343,7 +345,7 @@ events on the same response; there is no microphone, video, or lipsync. It never
343
345
  interaction via the `characterSessionId` event.
344
346
 
345
347
  We recommend SSE for chat and realtime for voice: start on SSE and move the same conversation to
346
- realtime when the user wants to talk. See [Choosing a Transport](docs/convai_choosing_transport.md)
348
+ realtime when the user wants to talk. See [Choosing a Transport](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/choose-a-transport)
347
349
  for why, and for building on one transport only.
348
350
 
349
351
  Because it needs neither WebRTC nor a DOM, this is the only transport that runs outside a browser.
@@ -351,7 +353,7 @@ Import `@convai/web-sdk/core` from Node, SSR, or a serverless function — not t
351
353
  entry points, which pull in browser-only dependencies.
352
354
 
353
355
  The interaction API is currently reachable at staging only; a production host is planned.
354
- Full guide: [SSE Interaction Transport](docs/convai_sse_transport.md).
356
+ Full guide: [SSE Interaction Transport](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/sse-transport).
355
357
 
356
358
  ---
357
359
 
@@ -400,7 +402,7 @@ staging.
400
402
 
401
403
  Explicit selectors are resolved by the runtime through the Character REST platform. Staging has
402
404
  this today; production answers explicit selectors with `503` until it is promoted there.
403
- Full guide: [Character Versioning](docs/convai_character_versioning.md).
405
+ Full guide: [Character Versioning](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/character-versioning).
404
406
 
405
407
  ---
406
408
 
@@ -450,7 +452,7 @@ Key points:
450
452
  - Room-topology failures throw `ConvaiRoomError` with `status`, `code`, `requestTraceId` and `isRetryable`; the SDK retries `ROSTER_PROVISIONING_IN_PROGRESS` for you (`rosterProvisioningRetry`).
451
453
  - Action protocol v2 and `actionConfig.tools` are single-character only and cannot be combined with a roster.
452
454
 
453
- Full reference: [docs/convai_multi_character.md](docs/convai_multi_character.md).
455
+ Full reference: [Host several characters in one room](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/multi-character-rooms).
454
456
 
455
457
  ---
456
458
 
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.9.0";
1
+ export declare const SDK_VERSION = "1.9.1";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // GENERATED by scripts/sync-version.mjs — do not edit by hand.
2
2
  // Regenerated from package.json on every build.
3
- export const SDK_VERSION = "1.9.0";
3
+ export const SDK_VERSION = "1.9.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convai/web-sdk",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Build web apps with lifelike AI characters. The Convai Web SDK gives you real-time voice, lipsync, emotions, and dynamic context — with first-class support for React and vanilla TypeScript.",
5
5
  "private": false,
6
6
  "type": "module",