@microsoft/omnichannel-chat-sdk 2.0.0-main.307c235 → 2.0.0-main.8b87280
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 +1 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,6 @@ Please make sure you have a chat widget configured before using this package or
|
|
|
22
22
|
- [SDK Methods](#sdk-methods)
|
|
23
23
|
- [Initialization](#initialization)
|
|
24
24
|
- [Start Chat](#start-chat)
|
|
25
|
-
- [Authenticate Chat](#authenticate-chat)
|
|
26
25
|
- [End Chat](#end-chat)
|
|
27
26
|
- [Get Pre-Chat Survey](#get-pre-chat-survey)
|
|
28
27
|
- [Get Live Chat Config](#get-live-chat-config)
|
|
@@ -135,7 +134,7 @@ The npm `latest` dist-tag can point to a `main` prerelease. Use the exact versio
|
|
|
135
134
|
|
|
136
135
|
Regenerate the application lockfile after the update. Then run the application build and tests on Node.js 22.
|
|
137
136
|
|
|
138
|
-
Version `2.0.0` adds progressive bot-message streaming,
|
|
137
|
+
Version `2.0.0` adds progressive bot-message streaming, read receipts, and unread-message counts. Existing `onNewMessage` handlers continue to receive final streaming messages.
|
|
139
138
|
|
|
140
139
|
See the [2.0 migration guide](docs/MIGRATION_2.0.md) for the complete upgrade and validation procedure.
|
|
141
140
|
|
|
@@ -331,32 +330,6 @@ const optionalParams = {
|
|
|
331
330
|
await chatSDK.startChat(optionalParams);
|
|
332
331
|
```
|
|
333
332
|
|
|
334
|
-
### Authenticate Chat
|
|
335
|
-
|
|
336
|
-
It authenticates an active unauthenticated conversation. Enable optional authenticated sign-in for the workstream before you use this method.
|
|
337
|
-
|
|
338
|
-
Call `initialize()` and `startChat()` before `authenticateChat()`. The first argument can be a token or an asynchronous token provider.
|
|
339
|
-
|
|
340
|
-
```ts
|
|
341
|
-
await chatSDK.initialize();
|
|
342
|
-
await chatSDK.startChat();
|
|
343
|
-
|
|
344
|
-
await chatSDK.authenticateChat(async () => {
|
|
345
|
-
const response = await fetch("https://contoso.example/token");
|
|
346
|
-
if (!response.ok) {
|
|
347
|
-
throw new Error("Token request failed");
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
return response.text();
|
|
351
|
-
}, {
|
|
352
|
-
refreshChatToken: true
|
|
353
|
-
});
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
Set `refreshChatToken` to `true` when subsequent SDK calls must use a refreshed authenticated chat token.
|
|
357
|
-
|
|
358
|
-
The method throws `InvalidConversation` when no conversation is active. It throws `MidConversationAuthFailure` when token resolution or authentication fails.
|
|
359
|
-
|
|
360
333
|
### End Chat
|
|
361
334
|
|
|
362
335
|
It ends the current Omnichannel conversation.
|