@active-reach/web-sdk 1.39.0 → 1.41.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/dist/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/{analytics-DoHdxjjh.mjs → analytics-C-Go3Pm5.mjs} +15 -1
- package/dist/{analytics-DoHdxjjh.mjs.map → analytics-C-Go3Pm5.mjs.map} +1 -1
- package/dist/core/analytics.d.ts +12 -0
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/prefetch-bundle-client.d.ts +3 -0
- package/dist/core/prefetch-bundle-client.d.ts.map +1 -1
- package/dist/inapp/AegisInAppManager.d.ts +3 -9
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inbox/AegisInbox.d.ts +3 -0
- package/dist/inbox/AegisInbox.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +165 -853
- package/dist/index.js.map +1 -1
- package/dist/react.js +1 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +19 -11
- package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
- package/dist/triggers/ContactScoresFetcher.d.ts +1 -0
- package/dist/triggers/ContactScoresFetcher.d.ts.map +1 -1
- package/dist/triggers/TriggerEngine.d.ts.map +1 -1
- package/dist/triggers/behaviouralTriggers.d.ts +41 -0
- package/dist/triggers/behaviouralTriggers.d.ts.map +1 -0
- package/dist/widgets/AegisWidgetManager.d.ts +8 -72
- package/dist/widgets/AegisWidgetManager.d.ts.map +1 -1
- package/dist/widgets/index.d.ts +1 -1
- package/dist/widgets/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3032,6 +3032,9 @@ class Aegis {
|
|
|
3032
3032
|
if (!this.assertInitialized()) return;
|
|
3033
3033
|
const wsForGovernor = this.getEffectiveWorkspaceId() || null;
|
|
3034
3034
|
const { sanitized: governedTraits } = this.traitGovernor.process(traits, wsForGovernor);
|
|
3035
|
+
if (this.identity.getUserId() !== userId) {
|
|
3036
|
+
this.contactToken = void 0;
|
|
3037
|
+
}
|
|
3035
3038
|
this.identity.setUserId(userId, governedTraits);
|
|
3036
3039
|
const event = {
|
|
3037
3040
|
type: "identify",
|
|
@@ -3286,6 +3289,16 @@ class Aegis {
|
|
|
3286
3289
|
if (!this.identity) return null;
|
|
3287
3290
|
return this.identity.getUserId();
|
|
3288
3291
|
}
|
|
3292
|
+
/**
|
|
3293
|
+
* C1b: register the server-minted proof for the CURRENT contact (as
|
|
3294
|
+
* returned by `getUserId()`). A host wiring `AegisMessageRuntime` calls
|
|
3295
|
+
* this alongside `runtime.updateContactId(id, token)` so `getRewards()`
|
|
3296
|
+
* can also present `X-Contact-Token`. Pass `undefined` to clear it (e.g.
|
|
3297
|
+
* on logout, or when the id changes without a fresh token).
|
|
3298
|
+
*/
|
|
3299
|
+
setContactToken(token) {
|
|
3300
|
+
this.contactToken = token;
|
|
3301
|
+
}
|
|
3289
3302
|
/**
|
|
3290
3303
|
* The Aegis short-link attribution captured from this visitor's landing URL
|
|
3291
3304
|
* (`aegis_code` + the link row's `aegis_campaign` / `aegis_journey` /
|
|
@@ -3319,6 +3332,7 @@ class Aegis {
|
|
|
3319
3332
|
"X-Contact-ID": contactId,
|
|
3320
3333
|
"X-User-ID": contactId
|
|
3321
3334
|
};
|
|
3335
|
+
if (this.contactToken) headers["X-Contact-Token"] = this.contactToken;
|
|
3322
3336
|
const orgId = config.organization_id;
|
|
3323
3337
|
if (orgId) headers["X-Organization-ID"] = orgId;
|
|
3324
3338
|
const location = this.getEffectiveLocationId();
|
|
@@ -3492,4 +3506,4 @@ export {
|
|
|
3492
3506
|
murmurhash3_x86_32 as m,
|
|
3493
3507
|
redactUrl as r
|
|
3494
3508
|
};
|
|
3495
|
-
//# sourceMappingURL=analytics-
|
|
3509
|
+
//# sourceMappingURL=analytics-C-Go3Pm5.mjs.map
|