@elevenlabs/react 0.2.2 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +20 -5
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -108,11 +108,26 @@ const conversation = useConversation({
108
108
  },
109
109
  conversation: {
110
110
  textOnly: true,
111
- }
111
+ },
112
112
  },
113
113
  });
114
114
  ```
115
115
 
116
+ #### User identification
117
+
118
+ You can optionally pass a user ID to identify the user in the conversation. This can be your own customer identifier. This will be included in the conversation initiation data sent to the server:
119
+
120
+ Tracking this ID can be helpful for filtering conversations, tracking analytics on a user level, etc.
121
+
122
+ ```ts
123
+ // Or pass it when starting the session
124
+ const conversationId = await conversation.startSession({
125
+ agentId: "<your-agent-id>",
126
+ userId: "user-123",
127
+ connectionType: "webrtc",
128
+ });
129
+ ```
130
+
116
131
  #### Text only
117
132
 
118
133
  If your agent is configured to run in text-only mode, i.e. it does not send or receive audio messages,
@@ -175,8 +190,8 @@ const conversation = useConversation();
175
190
 
176
191
  // For public agents, pass in the agent ID and the connection type
177
192
  const conversationId = await conversation.startSession({
178
- agentId: '<your-agent-id>',
179
- connectionType: 'webrtc', // either 'webrtc' or 'websocket'
193
+ agentId: "<your-agent-id>",
194
+ connectionType: "webrtc", // either 'webrtc' or 'websocket'
180
195
  });
181
196
  ```
182
197
 
@@ -220,7 +235,7 @@ const signedUrl = await response.text();
220
235
 
221
236
  const conversation = await Conversation.startSession({
222
237
  signedUrl,
223
- connectionType: 'websocket',
238
+ connectionType: "websocket",
224
239
  });
225
240
  ```
226
241
 
@@ -258,7 +273,7 @@ const conversationToken = await response.text();
258
273
 
259
274
  const conversation = await Conversation.startSession({
260
275
  conversationToken,
261
- connectionType: 'webrtc',
276
+ connectionType: "webrtc",
262
277
  });
263
278
  ```
264
279
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/react",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "ElevenLabs React Library",
5
5
  "main": "./dist/lib.umd.js",
6
6
  "module": "./dist/lib.module.js",
@@ -19,7 +19,7 @@
19
19
  "author": "ElevenLabs",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@elevenlabs/client": "0.2.2"
22
+ "@elevenlabs/client": "0.3.0"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0"