@active-reach/web-sdk 1.41.0 → 1.42.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/inapp/AegisInAppManager.d.ts +11 -0
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/index.js +185 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime/AegisMessageRuntime.d.ts +2 -0
- package/dist/runtime/AegisMessageRuntime.d.ts.map +1 -1
- package/dist/triggers/behaviouralTriggers.d.ts +3 -0
- package/dist/triggers/behaviouralTriggers.d.ts.map +1 -1
- package/dist/triggers/microIntentTriggers.d.ts +80 -0
- package/dist/triggers/microIntentTriggers.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -108,6 +108,8 @@ export declare class AegisMessageRuntime {
|
|
|
108
108
|
private readonly ownsTriggerEngine;
|
|
109
109
|
/** Engine events already armed for in-app client triggers (one subscription each). */
|
|
110
110
|
private readonly armedInAppTriggers;
|
|
111
|
+
/** Smart triggers (`micro_intent`): armed into the evaluator on every campaign load. */
|
|
112
|
+
private readonly microIntent;
|
|
111
113
|
private readonly unsubscribeCampaignsLoaded;
|
|
112
114
|
/** apiHost captured for the device-pairing entry (`?aegis_pair=CODE`). */
|
|
113
115
|
private readonly pairingApiHost;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisMessageRuntime.d.ts","sourceRoot":"","sources":["../../src/runtime/AegisMessageRuntime.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,iBAAiB,EAAqB,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC7I,OAAO,EAAE,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3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KG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAO1B;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKxC;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IASf;;;;;OAKG;IACH,YAAY,IAAI,aAAa,EAAE;CAMhC"}
|
|
@@ -16,6 +16,9 @@ export interface ClientTrigger {
|
|
|
16
16
|
config?: Record<string, unknown>;
|
|
17
17
|
}
|
|
18
18
|
export declare const BEHAVIOURAL_TRIGGER_TYPES: readonly ["exit_intent", "scroll_depth", "time_on_page", "inactivity"];
|
|
19
|
+
export declare const DEFAULT_SCROLL_DEPTH_PERCENT = 50;
|
|
20
|
+
export declare const DEFAULT_TIME_ON_PAGE_SECONDS = 30;
|
|
21
|
+
export declare const DEFAULT_IDLE_SECONDS = 30;
|
|
19
22
|
/**
|
|
20
23
|
* The client event a behavioural trigger fires on — the TriggerEngine's own
|
|
21
24
|
* event name — or null when the trigger is not behavioural.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"behaviouralTriggers.d.ts","sourceRoot":"","sources":["../../src/triggers/behaviouralTriggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,yBAAyB,wEAK5B,CAAC;
|
|
1
|
+
{"version":3,"file":"behaviouralTriggers.d.ts","sourceRoot":"","sources":["../../src/triggers/behaviouralTriggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,yBAAyB,wEAK5B,CAAC;AAEX,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAC/C,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAOvC;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAehG;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAQ9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,aAAa,CAAC,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC,EACzD,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,EAClB,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,EACjC,QAAQ,EAAE,OAAO,GAChB,MAAM,EAAE,CA+BV"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart trigger (`micro_intent`) arming — the production caller the
|
|
3
|
+
* IntentRuleEvaluator never had (Aman 2026-09-28, plan
|
|
4
|
+
* GAMIFICATION_ENGAGEMENT_TARGETING_PLAN §0d).
|
|
5
|
+
*
|
|
6
|
+
* A `micro_intent` campaign is served as `client_trigger: { type:
|
|
7
|
+
* 'micro_intent', config: <IntentRule> }`. Before this module nothing called
|
|
8
|
+
* `setArmed`, nothing turned a TriggerEngine event into an evaluator signal,
|
|
9
|
+
* and `converted_in_session` was never written — so `NOT(converted)` stayed
|
|
10
|
+
* null and every rule carrying it could never fire.
|
|
11
|
+
*
|
|
12
|
+
* This arms the evaluator on every campaign load, registers the engine
|
|
13
|
+
* thresholds the rules read (the `fire_on` signals and every numeric leaf of
|
|
14
|
+
* `time_on_page` / `scroll_depth` / `inactivity`), writes each engine event
|
|
15
|
+
* into the snapshot, and asks the evaluator for a decision.
|
|
16
|
+
*
|
|
17
|
+
* Signals owned elsewhere: Layer-1 scores (ContactScoresFetcher), `cart_value`
|
|
18
|
+
* (runtime updateContext). Hover / rage-click / SKU dwell need the
|
|
19
|
+
* IntentSnapshotCollector + SelectorBinder, which no host wires yet — rules on
|
|
20
|
+
* them stay unmet (null), never fire.
|
|
21
|
+
*/
|
|
22
|
+
import type { TriggerEngine } from './TriggerEngine';
|
|
23
|
+
import type { ArmedCampaign, IntentRule, IntentRuleEvaluator } from './IntentRuleEvaluator';
|
|
24
|
+
import { type ClientTrigger } from './behaviouralTriggers';
|
|
25
|
+
export declare const MICRO_INTENT_TRIGGER_TYPE = "micro_intent";
|
|
26
|
+
/** Signals whose value is a count the engine reports at registered thresholds. */
|
|
27
|
+
declare const THRESHOLD_SIGNALS: {
|
|
28
|
+
readonly time_on_page: 30;
|
|
29
|
+
readonly scroll_depth: 50;
|
|
30
|
+
readonly inactivity: 30;
|
|
31
|
+
};
|
|
32
|
+
type ThresholdSignal = keyof typeof THRESHOLD_SIGNALS;
|
|
33
|
+
/** The rule a `micro_intent` trigger carries, or null when it is not one or is malformed. */
|
|
34
|
+
export declare function microIntentRule(trigger: ClientTrigger | null | undefined): IntentRule | null;
|
|
35
|
+
/** Every loaded campaign whose client trigger is a well-formed smart trigger. */
|
|
36
|
+
export declare function armedMicroIntentCampaigns(campaigns: ReadonlyArray<{
|
|
37
|
+
id: string;
|
|
38
|
+
client_trigger?: ClientTrigger | null;
|
|
39
|
+
}>): ArmedCampaign[];
|
|
40
|
+
/**
|
|
41
|
+
* The engine thresholds at which `signal` must be observed for `rules` to be
|
|
42
|
+
* decided truthfully: each numeric leaf's crossing point (`gte 8` → 8,
|
|
43
|
+
* `gt 8` → 9), plus the builder default when a rule fires on the signal but
|
|
44
|
+
* never names a value.
|
|
45
|
+
*/
|
|
46
|
+
export declare function signalThresholds(rules: ReadonlyArray<IntentRule>, signal: ThresholdSignal): number[];
|
|
47
|
+
export interface MicroIntentArmingConfig {
|
|
48
|
+
engine: TriggerEngine;
|
|
49
|
+
evaluator: IntentRuleEvaluator;
|
|
50
|
+
/** Display the campaign; true only when it actually showed. */
|
|
51
|
+
show: (campaignId: string) => boolean;
|
|
52
|
+
/** Whether this session already converted (the in-app manager's record). */
|
|
53
|
+
hasConverted: () => boolean;
|
|
54
|
+
/** No hovering pointer: exit intent is the engine's fast scroll up. */
|
|
55
|
+
isMobile: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare class MicroIntentArming {
|
|
58
|
+
private readonly cfg;
|
|
59
|
+
private readonly registered;
|
|
60
|
+
private listening;
|
|
61
|
+
private readonly onEngineEvent;
|
|
62
|
+
constructor(cfg: MicroIntentArmingConfig);
|
|
63
|
+
/** Replace the armed rules with the smart triggers among `campaigns`. */
|
|
64
|
+
arm(campaigns: ReadonlyArray<{
|
|
65
|
+
id: string;
|
|
66
|
+
client_trigger?: ClientTrigger | null;
|
|
67
|
+
}>): void;
|
|
68
|
+
/** The host reported a conversion: rules gated on NOT converted stop matching. */
|
|
69
|
+
noteConversion(): void;
|
|
70
|
+
destroy(): void;
|
|
71
|
+
private once;
|
|
72
|
+
/** Subscribe once, and seed the page-start values: nothing scrolled, no
|
|
73
|
+
* time elapsed, no exit yet, conversion as the manager recorded it. A null
|
|
74
|
+
* here would make every AND/NOT over these signals unprovable. */
|
|
75
|
+
private listen;
|
|
76
|
+
private handle;
|
|
77
|
+
private decide;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
80
|
+
//# sourceMappingURL=microIntentTriggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"microIntentTriggers.d.ts","sourceRoot":"","sources":["../../src/triggers/microIntentTriggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,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AuB;IAIxC,yEAAyE;IACzE,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI;IAwB1F,kFAAkF;IAClF,cAAc,IAAI,IAAI;IAItB,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,IAAI;IAMZ;;uEAEmE;IACnE,OAAO,CAAC,MAAM;IAmBd,OAAO,CAAC,MAAM;IAwBd,OAAO,CAAC,MAAM;CAQf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@active-reach/web-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Web SDK for Active Reach Intelligence — event tracking, identity resolution, in-app messaging, web push, and placements",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|