bridgeapp-ai-chat-widget 0.0.13 → 0.1.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
@@ -15,19 +15,28 @@ import { ChatWidgetInstance } from "bridge-ai-chat-widget";
15
15
 
16
16
  const widget = new ChatWidgetInstance({
17
17
  mountElementId: "chat-widget-root",
18
- agentId: "AGENT_ID";
19
- chatId: "CHAT_ID";
20
- widgetSessionToken: "WIDGET_SESSION_TOKEN";
21
- assetsUrl: "ASSETS_URL";
22
- wsUrl: 'wss://ws.brid93.dev/ws',
23
- apiUrl: 'https://api.brid93.dev',
18
+ agentId: "AGENT_ID",
19
+ customerInteractionSession: {
20
+ accessToken: "ACCESS_TOKEN",
21
+ chatId: "CHAT_ID",
22
+ expiresAt: new Date(Date.now() + 86400000).toISOString(),
23
+ },
24
+ assetsUrl: "ASSETS_URL",
25
+ wsUrl: "wss://ws.brid93.dev/ws",
26
+ apiUrl: "https://api.brid93.dev",
24
27
  AIAvatar: true,
25
- background: false
28
+ background: false,
29
+ voiceEnabled: true,
26
30
  });
27
31
 
28
- widget.addEventListener("avatarReady", () => {
32
+ widget.addEventListener("avatar_ready", () => {
29
33
  widget.playAnimation("excited"); //'excited' | 'fix_hair' | 'spin' | 'kiss'
30
34
  });
35
+
36
+ //this event is thrown either when session is already expired or about to be expired
37
+ widget.addEventListener("renew_session", () => {
38
+ //do something
39
+ });
31
40
  ```
32
41
 
33
42
  ```javascript