@nuancelabs/js-sdk 0.15.0 → 0.34.0

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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nuancelabs/js-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.34.0",
4
4
  "description": "JavaScript SDK for Nuance Labs conversation video AI avatar",
5
- "license": "UNLICENSED",
5
+ "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/nuance-labs-ai/nuance.git",
package/react/index.d.ts CHANGED
@@ -29,9 +29,9 @@ export declare interface NuanceConversationHook {
29
29
  /**
30
30
  * One conversation at a time in a React component: its state and error, refs
31
31
  * for the elements the avatar plays in, and start and end. The hook leaves the
32
- * conversation when the session ends (so the camera and microphone turn off)
33
- * and when the component unmounts. Each start uses the options of the latest
34
- * render.
32
+ * conversation when the session ends (so the camera and microphone turn off),
33
+ * even with `stayConnectedOnEnd`, and when the component unmounts. Each start
34
+ * uses the options of the latest render.
35
35
  *
36
36
  * @example
37
37
  * ```tsx
package/react/index.js CHANGED
@@ -71,8 +71,13 @@ class ConversationStore {
71
71
  this.update({ state: event.state });
72
72
  if (event.type === "tracks-changed")
73
73
  this.attach();
74
- if (event.type === "session-ended")
74
+ if (event.type === "session-ended") {
75
+ if (event.error) {
76
+ this.update({ error: event.error });
77
+ return;
78
+ }
75
79
  this.end();
80
+ }
76
81
  });
77
82
  this.update({ state: conversation.state, error: null, conversation });
78
83
  if (previous)