@levo-so/insights 0.3.10 → 0.3.12
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/constants/storageKeys.d.ts +22 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +181 -379
- package/dist/lib/identityHeaders.d.ts +22 -0
- package/dist/lib/insights.d.ts +2 -1
- package/dist/lib/rotation.d.ts +42 -0
- package/dist/lib/transport.d.ts +45 -0
- package/dist/stores/events.d.ts +12 -17
- package/dist/stores/identity.d.ts +111 -0
- package/dist/stores/readiness.d.ts +6 -6
- package/dist/stores/session.d.ts +12 -21
- package/dist/stores/sessionProperties.d.ts +116 -0
- package/dist/stores.d.ts +1 -0
- package/dist/stores.js +2 -2
- package/dist/textSelection-CXG4e3wj.js +948 -0
- package/dist/types/endpoint.d.ts +38 -0
- package/dist/types/identity.d.ts +0 -1
- package/dist/utils/cookies.d.ts +23 -0
- package/dist/utils/detectMode.d.ts +20 -7
- package/dist/utils/getAsyncUserProperties.d.ts +6 -0
- package/dist/utils/getAuthHeaders.d.ts +17 -4
- package/dist/utils/getUserProperties.d.ts +28 -3
- package/dist/utils/sanitizeEvent.d.ts +51 -0
- package/package.json +9 -6
- package/dist/textSelection-Cwq6lqKg.js +0 -604
- package/dist/utils/pingEndpoint.d.ts +0 -4
|
@@ -3,33 +3,38 @@
|
|
|
3
3
|
* These are the same keys used in createLevoInsights.
|
|
4
4
|
*/
|
|
5
5
|
export declare const STORAGE_KEYS: {
|
|
6
|
-
/**
|
|
7
|
-
readonly identify: "lock:lv_aud_identify";
|
|
8
|
-
/** Namespace prefix for per-tab heartbeat keys (`${open_tabs}:${tabId}`) — see tracking/currentTab.ts */
|
|
6
|
+
/** Namespace prefix for per-tab heartbeat keys (`${open_tabs}:${tabId}`), see tracking/currentTab.ts */
|
|
9
7
|
readonly open_tabs: "lv_insights_ot";
|
|
10
8
|
/** Key for current tab ID (sessionStorage) */
|
|
11
9
|
readonly current_tab: "lv_insights_ct";
|
|
12
|
-
/**
|
|
13
|
-
readonly device_token: "lv_aud_device";
|
|
14
|
-
/** Session JWT for direct mode (1yr expiry, rotated on /welcome, analytics-only scope) */
|
|
15
|
-
readonly session_token: "lv_aud_session";
|
|
16
|
-
/** Cached insights mode ('proxy' | 'direct') */
|
|
17
|
-
readonly mode: "lv_aud_mode";
|
|
18
|
-
/** Key to store session data **/
|
|
10
|
+
/** Key to store session data: endpoint, identity traits, legacy deviceToken. */
|
|
19
11
|
readonly session: "lv_insights_session";
|
|
20
|
-
/**
|
|
21
|
-
* sessionStorage key for identification flags (isIdentified).
|
|
22
|
-
* Stored separately in sessionStorage so it resets when the browser session
|
|
23
|
-
* ends, preventing stale isIdentified from blocking /welcome across restarts.
|
|
24
|
-
*/
|
|
25
|
-
readonly session_flags: "lv_insights_sf";
|
|
26
12
|
/**
|
|
27
13
|
* sessionStorage key for the last non-direct attribution (channel/referrer/UTM)
|
|
28
14
|
* of the CURRENT browsing session. Used to carry the original source forward when
|
|
29
15
|
* the visitor-source library would otherwise report "internalLink" for same-site
|
|
30
16
|
* continued browsing after the server cuts a session at its 30-min idle threshold.
|
|
31
|
-
* Session-scoped on purpose
|
|
17
|
+
* Session-scoped on purpose. See utils/getReferrer.ts (a long-lived store would
|
|
32
18
|
* mis-attribute a fresh visit days later).
|
|
33
19
|
*/
|
|
34
20
|
readonly attribution: "lv_insights_attr";
|
|
21
|
+
/**
|
|
22
|
+
* Client-minted identity: device id, session id and the session clock.
|
|
23
|
+
* localStorage, so it is shared across tabs and survives revisits.
|
|
24
|
+
*/
|
|
25
|
+
readonly identity: "lv_insights_identity";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Cookie names for client-minted identity.
|
|
29
|
+
*
|
|
30
|
+
* The `c` marks the SDK as the writer: the server owns `id_i_d`/`id_i_s` and
|
|
31
|
+
* never writes these, so a `Cookie` header can never carry two same-name values
|
|
32
|
+
* with different formats. Values are raw Snowflake ids, the server validates
|
|
33
|
+
* them as ids, and anything else in the slot is skipped, not reinterpreted.
|
|
34
|
+
*/
|
|
35
|
+
export declare const COOKIE_KEYS: {
|
|
36
|
+
/** Client-minted device id. Never rotates. */
|
|
37
|
+
readonly client_device: "id_i_cd";
|
|
38
|
+
/** Client-minted session id. Rotates on idle, sign-out and account switch. */
|
|
39
|
+
readonly client_session: "id_i_cs";
|
|
35
40
|
};
|
package/dist/index.d.ts
CHANGED