@cimulate/copilot-widget 1.31.0 → 1.32.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/CHANGELOG.md +4 -0
- package/dist/messaging.d.ts +35 -0
- package/dist/messaging.es.js +8371 -8321
- package/dist/messaging.umd.js +30 -30
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
`@cimulate/copilot-widget` follows [Semantic Versioning](https://semver.org/). Each entry is a released `package.json` version (deployed on merge to `master`), newest first.
|
|
4
4
|
|
|
5
|
+
## 1.32.0 — 2026-08-28
|
|
6
|
+
|
|
7
|
+
- Added `getAuthLinkKey()` for retrieving a single-use auth link key for the current conversation, so hosts can bridge a guest shopper's session (e.g. a SLAS/commerce session) into the conversation and let the agent inherit the shopper's identity and cart. Exposed both to React hosts via `useMessaging().getAuthLinkKey()` and to script-tag/CDN hosts via `window.CimulateMessaging.getAuthLinkKey()`. The key is single-use: each call mints a fresh key the server invalidates on redemption, so callers must request a new one rather than caching or retrying with a consumed key. The CDN export is async and rejects (rather than throwing synchronously) when called before the widget is ready. Requires `@cimulate/agentforce-sdk` 1.3.0, which adds the underlying auth-link-key v2 retrieval.
|
|
8
|
+
|
|
5
9
|
## 1.31.0 — 2026-08-27
|
|
6
10
|
|
|
7
11
|
- Messaging mode now defers SCRT2 connection and conversation creation until the shopper opens the widget or sends the first message. Concurrent engagement signals share one initialization, and persisted conversations still resume before a new conversation is created.
|
package/dist/messaging.d.ts
CHANGED
|
@@ -349,6 +349,33 @@ export declare const eventHandlers: {
|
|
|
349
349
|
|
|
350
350
|
declare type FacetFilters = Record<string, string[]>;
|
|
351
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Retrieve a single-use auth link key for the current conversation.
|
|
354
|
+
*
|
|
355
|
+
* The host-page/script-tag counterpart of the `getAuthLinkKey` method on the
|
|
356
|
+
* messaging context (React hosts use `useMessaging().getAuthLinkKey()`). Hand
|
|
357
|
+
* the returned key to your own backend, which bridges the shopper's session
|
|
358
|
+
* (e.g. a SLAS/commerce session) into the conversation so the agent inherits
|
|
359
|
+
* the shopper's identity — and cart.
|
|
360
|
+
*
|
|
361
|
+
* Call after `injectMessagingWidget()` has mounted the widget; rejects if the
|
|
362
|
+
* widget is not yet ready or the request fails. `async` so the registry's
|
|
363
|
+
* synchronous "not ready" throw surfaces as a rejected promise (honoring the
|
|
364
|
+
* contract for `.catch()` callers, not just `await`).
|
|
365
|
+
*
|
|
366
|
+
* The key is **single-use**: each call mints a fresh key that the server
|
|
367
|
+
* invalidates once redeemed. Do not cache it or retry a rejected call with the
|
|
368
|
+
* same key — request a new one, or you will send the backend a key it already
|
|
369
|
+
* consumed.
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```js
|
|
373
|
+
* const authLinkKey = await window.CimulateMessaging.getAuthLinkKey();
|
|
374
|
+
* await fetch("/bridge-session", { method: "POST", body: JSON.stringify({ authLinkKey }) });
|
|
375
|
+
* ```
|
|
376
|
+
*/
|
|
377
|
+
export declare function getAuthLinkKey(): Promise<string>;
|
|
378
|
+
|
|
352
379
|
declare interface HeaderConfig {
|
|
353
380
|
logoUrl?: string;
|
|
354
381
|
headerText?: string;
|
|
@@ -444,6 +471,14 @@ export declare interface MessagingContextType {
|
|
|
444
471
|
retryLastMessage: () => ReturnType<SendMessage> | undefined;
|
|
445
472
|
retryConnection: () => void;
|
|
446
473
|
downloadTranscript: () => Promise<void>;
|
|
474
|
+
/**
|
|
475
|
+
* Retrieve a single-use auth link key for the current conversation. The host
|
|
476
|
+
* hands the key to its own backend, which bridges the shopper's session (e.g.
|
|
477
|
+
* a SLAS/commerce session) into this conversation so the agent inherits the
|
|
478
|
+
* shopper's identity — and cart. Resolves with the key; rejects if the widget
|
|
479
|
+
* is not connected or the request fails.
|
|
480
|
+
*/
|
|
481
|
+
getAuthLinkKey: () => Promise<string>;
|
|
447
482
|
}
|
|
448
483
|
|
|
449
484
|
/**
|