@voice-ai-labs/web-sdk 1.0.0 → 1.0.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 +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -294,6 +294,8 @@ Today the SDK includes one Google entry:
|
|
|
294
294
|
|
|
295
295
|
Use the managed Google surface to connect an agent to Google Calendar, Sheets, or Gmail.
|
|
296
296
|
|
|
297
|
+
For a working browser example, see [`demo/managed-tools.html`](https://github.com/voice-ai/web-sdk/blob/main/demo/managed-tools.html).
|
|
298
|
+
|
|
297
299
|
```typescript
|
|
298
300
|
import VoiceAI, {
|
|
299
301
|
GOOGLE_CALENDAR_OPERATION_OPTIONS,
|
|
@@ -331,7 +333,7 @@ const reconnect = getGoogleReconnectState(
|
|
|
331
333
|
|
|
332
334
|
Connection flow:
|
|
333
335
|
|
|
334
|
-
1. Call `startOAuth(...)` with the agent ID, `returnUrl`, and the
|
|
336
|
+
1. Call `startOAuth(...)` with the agent ID, `returnUrl`, and the currently enabled Google managed tool config for the agent.
|
|
335
337
|
2. Open the returned `auth_url` in a popup or browser tab.
|
|
336
338
|
3. Google redirects to the VoiceAI backend callback.
|
|
337
339
|
4. The backend completes OAuth and then returns the user to your `returnUrl`.
|
|
@@ -340,9 +342,9 @@ Connection flow:
|
|
|
340
342
|
Connection semantics:
|
|
341
343
|
|
|
342
344
|
- `startOAuth(...)` manages Google managed-tools access for the agent
|
|
343
|
-
-
|
|
344
|
-
- enabling more Google operations later can require reconnecting to grant
|
|
345
|
-
- `disconnect(...)` removes Google managed-tools access for that agent
|
|
345
|
+
- the Google connection is shared across Calendar, Sheets, and Gmail for that agent
|
|
346
|
+
- enabling more Google operations later can require reconnecting to grant access for the currently enabled Google tools
|
|
347
|
+
- `disconnect(...)` removes Google managed-tools access for all Google tools on that agent
|
|
346
348
|
|
|
347
349
|
Available helpers:
|
|
348
350
|
|
|
@@ -393,7 +395,8 @@ Supported Gmail operations:
|
|
|
393
395
|
Notes:
|
|
394
396
|
|
|
395
397
|
- Google Calendar, Sheets, and Gmail all use the `voiceai.managedTools.google` surface.
|
|
396
|
-
-
|
|
398
|
+
- `startOAuth(...)` uses the Google managed tool config you pass in `managedTools` to determine the scopes requested for the shared agent-level Google connection.
|
|
399
|
+
- If you enable additional Google operations later, `getStatus()` / `getGoogleReconnectState(...)` may report `reconnect_required` until you reconnect and grant access for the currently enabled Google tools.
|
|
397
400
|
- `voiceai.managedTools.google.disconnect(agentId)` removes Google managed-tools access for the agent.
|
|
398
401
|
- `returnUrl` is your app/frontend return target after the VoiceAI backend callback completes. It is not the Google-registered OAuth redirect URI.
|
|
399
402
|
- Calendar `timezone` should be an IANA timezone like `America/Los_Angeles`
|