@talqing/react 0.13.0 → 0.15.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/README.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # @talqing/react
2
2
 
3
3
  React bindings for Talqing web calls: join a voice or video agent from a browser,
4
- attach a photo mid-call, share a screen, read and write the session's userdata,
5
- and answer the agent when a tool calls back into your page.
4
+ attach a photo mid-call, share a screen, and answer the agent when a tool calls
5
+ back into your page.
6
+
7
+ > **Breaking changes in 0.14.0.** `useTalqingUserdata` is removed (and
8
+ > `getTalqingUserdata` / `setTalqingUserdata` with `@talqing/client` 0.7.0): the
9
+ > browser can no longer read or write a live session's userdata. Seed it with
10
+ > `userdata` when your server mints the call token; tools change it during the
11
+ > call. Requires `@talqing/client` ^0.7.0 and `@talqing/sdk` ^0.13.0.
6
12
 
7
13
  ```bash
8
14
  npm install @talqing/react
@@ -144,7 +150,6 @@ received them.
144
150
  | --- | --- |
145
151
  | `useTalqingImages(room)` | Send a photo to the agent mid-call and follow what became of it — four states, because the agent can go away mid-upload. |
146
152
  | `useTalqingScreenShare()` | Share a screen on the settings that keep it legible. `start()` must run inside a click. |
147
- | `useTalqingUserdata()` | Read and write the live session's userdata over RPC. |
148
153
  | `useTalqingRpcHandlers(handlers)` | Answer a tool's `frontend_rpc` calls into your page. `useTalqingFrontendRpcs()` is the declarative version. |
149
154
  | `useTalqingAvatarTrack()` | The track to render for a video agent. |
150
155
  | `TALQING_SCREEN_SHARE_CAPTURE` / `_PUBLISH` | The measured capture settings, exported so you can read them. |
@@ -1,6 +1,5 @@
1
1
  export { TalqingSessionProvider, useTalqingConnection, useTalqingSession, } from "./session.js";
2
2
  export type { TalqingCallOptions, TalqingSession, TalqingSessionOptions, } from "./session.js";
3
- export { useTalqingUserdata } from "./userdata.js";
4
3
  export { useTalqingImages } from "./images.js";
5
4
  export { useTalqingFrontendRpcs, useTalqingRpcHandlers } from "./rpc.js";
6
5
  export { useTalqingAvatarTrack, useTalqingScreenShare } from "./media.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQ1E,cAAc,iBAAiB,CAAC;AAYhC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQ1E,cAAc,iBAAiB,CAAC;AAYhC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -25,13 +25,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
25
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.VideoTrack = exports.useSessionMessages = exports.useAgent = exports.useTalqingScreenShare = exports.useTalqingAvatarTrack = exports.useTalqingRpcHandlers = exports.useTalqingFrontendRpcs = exports.useTalqingImages = exports.useTalqingUserdata = exports.useTalqingSession = exports.useTalqingConnection = exports.TalqingSessionProvider = void 0;
28
+ exports.VideoTrack = exports.useSessionMessages = exports.useAgent = exports.useTalqingScreenShare = exports.useTalqingAvatarTrack = exports.useTalqingRpcHandlers = exports.useTalqingFrontendRpcs = exports.useTalqingImages = exports.useTalqingSession = exports.useTalqingConnection = exports.TalqingSessionProvider = void 0;
29
29
  var session_js_1 = require("./session.js");
30
30
  Object.defineProperty(exports, "TalqingSessionProvider", { enumerable: true, get: function () { return session_js_1.TalqingSessionProvider; } });
31
31
  Object.defineProperty(exports, "useTalqingConnection", { enumerable: true, get: function () { return session_js_1.useTalqingConnection; } });
32
32
  Object.defineProperty(exports, "useTalqingSession", { enumerable: true, get: function () { return session_js_1.useTalqingSession; } });
33
- var userdata_js_1 = require("./userdata.js");
34
- Object.defineProperty(exports, "useTalqingUserdata", { enumerable: true, get: function () { return userdata_js_1.useTalqingUserdata; } });
35
33
  var images_js_1 = require("./images.js");
36
34
  Object.defineProperty(exports, "useTalqingImages", { enumerable: true, get: function () { return images_js_1.useTalqingImages; } });
37
35
  var rpc_js_1 = require("./rpc.js");
@@ -42,7 +40,7 @@ Object.defineProperty(exports, "useTalqingAvatarTrack", { enumerable: true, get:
42
40
  Object.defineProperty(exports, "useTalqingScreenShare", { enumerable: true, get: function () { return media_js_1.useTalqingScreenShare; } });
43
41
  /* All of `@talqing/client`, so one install and one import cover a web call.
44
42
  * Everything there works against any `Room`, with or without React — the token
45
- * source, the userdata and image and frontend-RPC calls, and the measured
43
+ * source, the image and frontend-RPC calls, and the measured
46
44
  * capture constants. Re-exported wholesale rather than as a curated list
47
45
  * because the whole package is meant to be reachable from here, and a list
48
46
  * would quietly fall behind it. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;AAEH,2CAIsB;AAHpB,oHAAA,sBAAsB,OAAA;AACtB,kHAAA,oBAAoB,OAAA;AACpB,+GAAA,iBAAiB,OAAA;AAQnB,6CAAmD;AAA1C,iHAAA,kBAAkB,OAAA;AAC3B,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,mCAAyE;AAAhE,gHAAA,sBAAsB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AACtD,uCAA0E;AAAjE,iHAAA,qBAAqB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAErD;;;;;mCAKmC;AACnC,kDAAgC;AAEhC;;;;;;;;;yCASyC;AACzC,8DAImC;AAHjC,4GAAA,QAAQ,OAAA;AACR,sHAAA,kBAAkB,OAAA;AAClB,8GAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;AAEH,2CAIsB;AAHpB,oHAAA,sBAAsB,OAAA;AACtB,kHAAA,oBAAoB,OAAA;AACpB,+GAAA,iBAAiB,OAAA;AAQnB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,mCAAyE;AAAhE,gHAAA,sBAAsB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AACtD,uCAA0E;AAAjE,iHAAA,qBAAqB,OAAA;AAAE,iHAAA,qBAAqB,OAAA;AAErD;;;;;mCAKmC;AACnC,kDAAgC;AAEhC;;;;;;;;;yCASyC;AACzC,8DAImC;AAHjC,4GAAA,QAAQ,OAAA;AACR,sHAAA,kBAAkB,OAAA;AAClB,8GAAA,UAAU,OAAA"}
@@ -31,7 +31,7 @@ type TalqingCallAuth =
31
31
  | {
32
32
  client: TalqingClient;
33
33
  agentId: string | null;
34
- /** `contact_key`, `userdata`, `vars` and the per-call agent selection.
34
+ /** `contact_key`, `userdata`, `vars`, `secrets` and the per-call agent selection.
35
35
  * Only on this branch: on the other two the server passes them when it
36
36
  * mints, which is what keeps a browser from choosing whose history to
37
37
  * resume. */
@@ -1,6 +1,5 @@
1
1
  export { TalqingSessionProvider, useTalqingConnection, useTalqingSession, } from "./session.js";
2
2
  export type { TalqingCallOptions, TalqingSession, TalqingSessionOptions, } from "./session.js";
3
- export { useTalqingUserdata } from "./userdata.js";
4
3
  export { useTalqingImages } from "./images.js";
5
4
  export { useTalqingFrontendRpcs, useTalqingRpcHandlers } from "./rpc.js";
6
5
  export { useTalqingAvatarTrack, useTalqingScreenShare } from "./media.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQ1E,cAAc,iBAAiB,CAAC;AAYhC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAQ1E,cAAc,iBAAiB,CAAC;AAYhC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
package/dist/esm/index.js CHANGED
@@ -10,13 +10,12 @@
10
10
  * imports and `instanceof` resolve to.
11
11
  */
12
12
  export { TalqingSessionProvider, useTalqingConnection, useTalqingSession, } from "./session.js";
13
- export { useTalqingUserdata } from "./userdata.js";
14
13
  export { useTalqingImages } from "./images.js";
15
14
  export { useTalqingFrontendRpcs, useTalqingRpcHandlers } from "./rpc.js";
16
15
  export { useTalqingAvatarTrack, useTalqingScreenShare } from "./media.js";
17
16
  /* All of `@talqing/client`, so one install and one import cover a web call.
18
17
  * Everything there works against any `Room`, with or without React — the token
19
- * source, the userdata and image and frontend-RPC calls, and the measured
18
+ * source, the image and frontend-RPC calls, and the measured
20
19
  * capture constants. Re-exported wholesale rather than as a curated list
21
20
  * because the whole package is meant to be reachable from here, and a list
22
21
  * would quietly fall behind it. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;mCAKmC;AACnC,cAAc,iBAAiB,CAAC;AAEhC;;;;;;;;;yCASyC;AACzC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;mCAKmC;AACnC,cAAc,iBAAiB,CAAC;AAEhC;;;;;;;;;yCASyC;AACzC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,UAAU,GACX,MAAM,2BAA2B,CAAC"}
@@ -31,7 +31,7 @@ type TalqingCallAuth =
31
31
  | {
32
32
  client: TalqingClient;
33
33
  agentId: string | null;
34
- /** `contact_key`, `userdata`, `vars` and the per-call agent selection.
34
+ /** `contact_key`, `userdata`, `vars`, `secrets` and the per-call agent selection.
35
35
  * Only on this branch: on the other two the server passes them when it
36
36
  * mints, which is what keeps a browser from choosing whose history to
37
37
  * resume. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talqing/react",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "React bindings for Talqing web calls: the session, images, screen share, userdata and frontend RPC.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://talqing.com",
@@ -54,16 +54,16 @@
54
54
  "dependencies": {},
55
55
  "peerDependencies": {
56
56
  "@livekit/components-react": "^2.9.21",
57
- "@talqing/client": "^0.6.0",
58
- "@talqing/sdk": "^0.12.0",
57
+ "@talqing/client": "^0.7.0",
58
+ "@talqing/sdk": "^0.14.0",
59
59
  "livekit-client": "^2.20.2",
60
60
  "react": "^18.3.1 || ^19.0.0",
61
61
  "react-dom": "^18.3.1 || ^19.0.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@livekit/components-react": "^2.9.24",
65
- "@talqing/client": "^0.6.0",
66
- "@talqing/sdk": "^0.12.0",
65
+ "@talqing/client": "^0.7.0",
66
+ "@talqing/sdk": "^0.14.0",
67
67
  "@types/react": "^19.0.0",
68
68
  "livekit-client": "^2.22.4",
69
69
  "react": "^19.0.0",
package/src/index.ts CHANGED
@@ -21,14 +21,13 @@ export type {
21
21
  TalqingSessionOptions,
22
22
  } from "./session.js";
23
23
 
24
- export { useTalqingUserdata } from "./userdata.js";
25
24
  export { useTalqingImages } from "./images.js";
26
25
  export { useTalqingFrontendRpcs, useTalqingRpcHandlers } from "./rpc.js";
27
26
  export { useTalqingAvatarTrack, useTalqingScreenShare } from "./media.js";
28
27
 
29
28
  /* All of `@talqing/client`, so one install and one import cover a web call.
30
29
  * Everything there works against any `Room`, with or without React — the token
31
- * source, the userdata and image and frontend-RPC calls, and the measured
30
+ * source, the image and frontend-RPC calls, and the measured
32
31
  * capture constants. Re-exported wholesale rather than as a curated list
33
32
  * because the whole package is meant to be reachable from here, and a list
34
33
  * would quietly fall behind it. */
package/src/session.tsx CHANGED
@@ -62,7 +62,7 @@ type TalqingCallAuth =
62
62
  | {
63
63
  client: TalqingClient;
64
64
  agentId: string | null;
65
- /** `contact_key`, `userdata`, `vars` and the per-call agent selection.
65
+ /** `contact_key`, `userdata`, `vars`, `secrets` and the per-call agent selection.
66
66
  * Only on this branch: on the other two the server passes them when it
67
67
  * mints, which is what keeps a browser from choosing whose history to
68
68
  * resume. */
package/src/userdata.ts DELETED
@@ -1,27 +0,0 @@
1
- "use client";
2
-
3
- import { useMemo } from "react";
4
- import {
5
- getTalqingUserdata,
6
- setTalqingUserdata,
7
- type JsonObject,
8
- } from "@talqing/client";
9
- import { useTalqingConnection } from "./session.js";
10
-
11
- /** Read and write the live session's userdata from inside a provider. */
12
- export function useTalqingUserdata() {
13
- const { room } = useTalqingConnection();
14
- return useMemo(
15
- () => ({
16
- get: (keys?: string[], responseTimeout?: number) => {
17
- if (!room) throw new Error("room is not connected");
18
- return getTalqingUserdata(room, keys, responseTimeout);
19
- },
20
- set: (patch: JsonObject, responseTimeout?: number) => {
21
- if (!room) throw new Error("room is not connected");
22
- return setTalqingUserdata(room, patch, responseTimeout);
23
- },
24
- }),
25
- [room],
26
- );
27
- }