@rudderstack/analytics-js 3.0.0-beta.12 → 3.0.0-beta.13
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -0
- package/README.md +57 -10
- package/dist/npm/index.d.ts +174 -76
- package/dist/npm/legacy/cjs/index.js +69 -41
- package/dist/npm/legacy/esm/index.js +69 -41
- package/dist/npm/legacy/umd/index.js +69 -41
- package/dist/npm/modern/bundled/cjs/index.js +65 -37
- package/dist/npm/modern/bundled/esm/index.js +65 -37
- package/dist/npm/modern/bundled/umd/index.js +65 -37
- package/dist/npm/modern/cjs/index.js +43 -28
- package/dist/npm/modern/esm/index.js +43 -28
- package/dist/npm/modern/umd/index.js +43 -28
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,24 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [3.0.0-beta.13](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.0-beta.12...@rudderstack/analytics-js@3.0.0-beta.13) (2023-10-16)
|
6
|
+
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* add support for session storage ([#1440](https://github.com/rudderlabs/rudder-sdk-js/issues/1440)) ([7e3106b](https://github.com/rudderlabs/rudder-sdk-js/commit/7e3106b5317af05ad28a9c0c22a50638dbaebdc2))
|
11
|
+
* **analytics-js-service-worker:** deprecate service worker export of rudder-sdk-js package in favor of the new standalone package([#1437](https://github.com/rudderlabs/rudder-sdk-js/issues/1437)) ([1797d3e](https://github.com/rudderlabs/rudder-sdk-js/commit/1797d3ef356e947a528c2de9abcfde245cc28178))
|
12
|
+
* dmt plugin for v3 ([#1412](https://github.com/rudderlabs/rudder-sdk-js/issues/1412)) ([97ee68a](https://github.com/rudderlabs/rudder-sdk-js/commit/97ee68a27daa5ce8c3a098cdc84c4ee7981f1149))
|
13
|
+
|
14
|
+
|
15
|
+
### Bug Fixes
|
16
|
+
|
17
|
+
* **analytics-js-loading-scripts:** add globalThis polyfill for safari ([#1446](https://github.com/rudderlabs/rudder-sdk-js/issues/1446)) ([bf111f8](https://github.com/rudderlabs/rudder-sdk-js/commit/bf111f8fc24fe75d183ea4924423e3c560ce457d))
|
18
|
+
* **analytics-js:** add global definitions extended window type ([#1445](https://github.com/rudderlabs/rudder-sdk-js/issues/1445)) ([b995635](https://github.com/rudderlabs/rudder-sdk-js/commit/b995635a7a3979173d35b34fa32b41b4429b166f))
|
19
|
+
* empty anonymous id after reset call ([#1433](https://github.com/rudderlabs/rudder-sdk-js/issues/1433)) ([b078347](https://github.com/rudderlabs/rudder-sdk-js/commit/b0783478917a75833f6e7133f10ad5f8999866de))
|
20
|
+
* identify traits type ([#1427](https://github.com/rudderlabs/rudder-sdk-js/issues/1427)) ([a58c919](https://github.com/rudderlabs/rudder-sdk-js/commit/a58c919ca36fc4e14d134455a08fe0e35f3e66ce))
|
21
|
+
* pass anonymous id load option to getanonymousid method ([#1443](https://github.com/rudderlabs/rudder-sdk-js/issues/1443)) ([e234a8f](https://github.com/rudderlabs/rudder-sdk-js/commit/e234a8fa7538ac84fbf451aa4b104c1b26b5a04e))
|
22
|
+
|
5
23
|
## [3.0.0-beta.12](https://github.com/rudderlabs/rudder-sdk-js/compare/@rudderstack/analytics-js@3.0.0-beta.11...@rudderstack/analytics-js@3.0.0-beta.12) (2023-10-02)
|
6
24
|
|
7
25
|
|
package/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<p align="center">
|
4
4
|
<a href="https://rudderstack.com/">
|
5
|
-
<img src="https://
|
5
|
+
<img alt="RudderStack" width="512" src="https://raw.githubusercontent.com/rudderlabs/rudder-sdk-js/develop/assets/rs-logo-full-light.jpg">
|
6
6
|
</a>
|
7
7
|
<br />
|
8
8
|
<caption>The Customer Data Platform for Developers</caption>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
---
|
21
21
|
|
22
|
-
#
|
22
|
+
# @rudderstack/analytics-js
|
23
23
|
|
24
24
|
RudderStack Javascript SDK for browsers.
|
25
25
|
|
@@ -27,9 +27,12 @@ RudderStack Javascript SDK for browsers.
|
|
27
27
|
|
28
28
|
## Table of Contents
|
29
29
|
|
30
|
-
- [**Installing the package**](
|
30
|
+
- [**Installing the package**](#installing-the-package)
|
31
|
+
- [**How to build the SDK**](#How-to-build-the-SDK)
|
32
|
+
- [**Usage in Chrome Extensions**](#usage-in-chrome-extensions)
|
33
|
+
- [**Usage in Serverless Runtimes**](#usage-in-serverless-runtimes)
|
31
34
|
|
32
|
-
##
|
35
|
+
## Installing the package
|
33
36
|
|
34
37
|
To install the package via npm, run the following command:
|
35
38
|
|
@@ -39,15 +42,59 @@ npm install @rudderstack/analytics-js --save
|
|
39
42
|
|
40
43
|
**Note that this NPM module is only meant to be used for a browser installation**. If you want to integrate RudderStack with your Node.js application, refer to the [**RudderStack Node.js repository**](https://github.com/rudderlabs/rudder-sdk-node).
|
41
44
|
|
45
|
+
### Available exports
|
46
|
+
|
47
|
+
Default export will fetch the plugins during runtime as federated modules in separate requests.
|
48
|
+
|
49
|
+
```javascript
|
50
|
+
import { RudderAnalytics } from '@rudderstack/analytics-js';
|
51
|
+
|
52
|
+
const analytics = new RudderAnalytics();
|
53
|
+
analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
|
54
|
+
window.rudderanalytics = analytics;
|
55
|
+
```
|
56
|
+
|
57
|
+
Bundled export will contain the plugins code as part of the bundle in build time.
|
58
|
+
|
59
|
+
```javascript
|
60
|
+
import { RudderAnalytics } from '@rudderstack/analytics-js/bundled';
|
61
|
+
|
62
|
+
const analytics = new RudderAnalytics();
|
63
|
+
analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
|
64
|
+
window.rudderanalytics = analytics;
|
65
|
+
```
|
66
|
+
|
67
|
+
Legacy export will contain the plugins code as part of the bundle in build time and support legacy browsers like IE11.
|
68
|
+
|
69
|
+
```javascript
|
70
|
+
import { RudderAnalytics } from '@rudderstack/analytics-js/legacy';
|
71
|
+
|
72
|
+
const analytics = new RudderAnalytics();
|
73
|
+
analytics.load(<WRITE_KEY>, <DATA_PLANE_URL>);
|
74
|
+
window.rudderanalytics = analytics;
|
75
|
+
```
|
76
|
+
|
77
|
+
## How to build the SDK
|
78
|
+
|
79
|
+
Look for run scripts in the `package.json` file for getting the browser minified and non-minified builds. The builds are
|
80
|
+
updated in the `dist` folder of the directory. Among the others, some of the important ones are:
|
81
|
+
|
82
|
+
- `npm run build:browser:modern`: This outputs **dist/cdn/modern** folder that contains the cdn package contents.
|
83
|
+
- `npm run build:npm`: This outputs **dist/npm** folder that contains the npm package contents.
|
84
|
+
|
42
85
|
## Usage in Chrome Extensions
|
43
86
|
|
44
|
-
RudderStack JS SDK can be used
|
87
|
+
RudderStack JS SDK can be used in Chrome Extensions with manifest v3, both as a content script (via the JavaScript SDK package)
|
88
|
+
or as a background script service worker (via the [service worker package](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker)).
|
89
|
+
|
90
|
+
For examples and specific details look into [Chrome Extensions Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/chrome-extension/USAGE.md)
|
45
91
|
|
46
|
-
|
92
|
+
## Usage in Serverless Runtimes
|
47
93
|
|
48
|
-
|
94
|
+
RudderStack JS SDK [service worker](https://www.npmjs.com/package/@rudderstack/analytics-js-service-worker) can be used
|
95
|
+
in serverless runtimes like Cloudflare Workers or Vercel Edge functions.
|
49
96
|
|
50
|
-
|
97
|
+
For examples and specific details look into:
|
51
98
|
|
52
|
-
|
53
|
-
|
99
|
+
- [Vercel Edge Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)
|
100
|
+
- [Cloudflare Worker Usage](https://github.com/rudderlabs/rudder-sdk-js/blob/main/examples/serverless/USAGE.md)
|
package/dist/npm/index.d.ts
CHANGED
@@ -16,58 +16,31 @@ interface ILogger {
|
|
16
16
|
}
|
17
17
|
type LogLevel = 'LOG' | 'INFO' | 'DEBUG' | 'WARN' | 'ERROR' | 'NONE';
|
18
18
|
|
19
|
-
type
|
20
|
-
url: string;
|
21
|
-
default: boolean;
|
22
|
-
};
|
23
|
-
/**
|
24
|
-
* Represents residency server input the options
|
25
|
-
*/
|
26
|
-
type ResidencyServerRegion = 'US' | 'EU';
|
27
|
-
|
28
|
-
type Nullable<T> = T | null;
|
19
|
+
type LoggerProvider = Record<Exclude<Lowercase<LogLevel>, Lowercase<'NONE'>>, (...data: any[]) => void>;
|
29
20
|
|
30
|
-
interface ExtensionPoint {
|
31
|
-
[lifeCycleName: string]: (...args: any[]) => unknown;
|
32
|
-
}
|
33
21
|
/**
|
34
|
-
*
|
35
|
-
* When index signature is provided, every key have to match the type, the types
|
36
|
-
* for 'name', 'deps', and 'initialize' is added as index signature.
|
22
|
+
* Service to log messages/data to output provider, default is console
|
37
23
|
*/
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
invoke: <T = any>(extPoint?: string, allowMultiple?: boolean, ...args: any[]) => Nullable<T>[];
|
57
|
-
invokeSingle: <T = any>(extPoint?: string, ...args: any[]) => Nullable<T>;
|
58
|
-
invokeMultiple: <T = any>(extPoint?: string, ...args: any[]) => Nullable<T>[];
|
59
|
-
}
|
24
|
+
declare class Logger implements ILogger {
|
25
|
+
minLogLevel: number;
|
26
|
+
scope?: string;
|
27
|
+
logProvider: LoggerProvider;
|
28
|
+
constructor(minLogLevel?: LogLevel, scope?: string, logProvider?: Console);
|
29
|
+
log(...data: any[]): void;
|
30
|
+
info(...data: any[]): void;
|
31
|
+
debug(...data: any[]): void;
|
32
|
+
warn(...data: any[]): void;
|
33
|
+
error(...data: any[]): void;
|
34
|
+
outputLog(logMethod: LogLevel, data: any[]): void;
|
35
|
+
setScope(scopeVal: string): void;
|
36
|
+
setMinLogLevel(logLevel: LogLevel): void;
|
37
|
+
/**
|
38
|
+
* Formats the console message using `scope` and styles
|
39
|
+
*/
|
40
|
+
formatLogData(data: any[]): any[];
|
41
|
+
}//# sourceMappingURL=Logger.d.ts.map
|
60
42
|
|
61
|
-
|
62
|
-
engine: IPluginEngine;
|
63
|
-
init(): void;
|
64
|
-
attachEffects(): void;
|
65
|
-
setActivePlugins(): void;
|
66
|
-
invokeMultiple<T = any>(extPoint?: string, ...args: any[]): Nullable<T>[];
|
67
|
-
invokeSingle<T = any>(extPoint?: string, ...args: any[]): Nullable<T>;
|
68
|
-
register(plugins: ExtensionPlugin[]): void;
|
69
|
-
}
|
70
|
-
type PluginName = 'BeaconQueue' | 'Bugsnag' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ErrorReporting' | 'ExternalAnonymousId' | 'GoogleLinker' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
43
|
+
type Nullable<T> = T | null;
|
71
44
|
|
72
45
|
/**
|
73
46
|
* Represents a generic object in the APIs
|
@@ -117,6 +90,57 @@ type APIEvent = {
|
|
117
90
|
type RudderEventType = 'page' | 'track' | 'identify' | 'alias' | 'group';
|
118
91
|
type ReadyCallback = () => void;
|
119
92
|
|
93
|
+
type RegionDetails = {
|
94
|
+
url: string;
|
95
|
+
default: boolean;
|
96
|
+
};
|
97
|
+
/**
|
98
|
+
* Represents residency server input the options
|
99
|
+
*/
|
100
|
+
type ResidencyServerRegion = 'US' | 'EU';
|
101
|
+
|
102
|
+
interface ExtensionPoint {
|
103
|
+
[lifeCycleName: string]: (...args: any[]) => unknown;
|
104
|
+
}
|
105
|
+
/**
|
106
|
+
* ExtensionPoint can be nested, e.g. 'sdk.initialize.phase1'
|
107
|
+
* When index signature is provided, every key have to match the type, the types
|
108
|
+
* for 'name', 'deps', and 'initialize' is added as index signature.
|
109
|
+
*/
|
110
|
+
interface ExtensionPlugin {
|
111
|
+
name: string;
|
112
|
+
initialize?: (state?: any) => void;
|
113
|
+
deps?: string[];
|
114
|
+
[key: string]: string | (() => void) | ExtensionPoint | ((...args: any[]) => unknown | void) | string[] | undefined;
|
115
|
+
}
|
116
|
+
type PluginEngineConfig = {
|
117
|
+
throws?: boolean | RegExp;
|
118
|
+
};
|
119
|
+
interface IPluginEngine {
|
120
|
+
plugins: ExtensionPlugin[];
|
121
|
+
byName: Record<string, ExtensionPlugin>;
|
122
|
+
cache: Record<string, ExtensionPlugin[]>;
|
123
|
+
config: PluginEngineConfig;
|
124
|
+
register: (plugin: ExtensionPlugin, state?: Record<string, any>) => void;
|
125
|
+
unregister: (name: string) => void;
|
126
|
+
getPlugin: (name: string) => ExtensionPlugin | undefined;
|
127
|
+
getPlugins: (extPoint?: string) => ExtensionPlugin[];
|
128
|
+
invoke: <T = any>(extPoint?: string, allowMultiple?: boolean, ...args: any[]) => Nullable<T>[];
|
129
|
+
invokeSingle: <T = any>(extPoint?: string, ...args: any[]) => Nullable<T>;
|
130
|
+
invokeMultiple: <T = any>(extPoint?: string, ...args: any[]) => Nullable<T>[];
|
131
|
+
}
|
132
|
+
|
133
|
+
interface IPluginsManager {
|
134
|
+
engine: IPluginEngine;
|
135
|
+
init(): void;
|
136
|
+
attachEffects(): void;
|
137
|
+
setActivePlugins(): void;
|
138
|
+
invokeMultiple<T = any>(extPoint?: string, ...args: any[]): Nullable<T>[];
|
139
|
+
invokeSingle<T = any>(extPoint?: string, ...args: any[]): Nullable<T>;
|
140
|
+
register(plugins: ExtensionPlugin[]): void;
|
141
|
+
}
|
142
|
+
type PluginName = 'BeaconQueue' | 'Bugsnag' | 'DeviceModeDestinations' | 'DeviceModeTransformation' | 'ErrorReporting' | 'ExternalAnonymousId' | 'GoogleLinker' | 'KetchConsentManager' | 'NativeDestinationQueue' | 'OneTrustConsentManager' | 'StorageEncryption' | 'StorageEncryptionLegacy' | 'StorageMigrator' | 'XhrQueue';
|
143
|
+
|
120
144
|
type OneTrustCookieCategory = {
|
121
145
|
oneTrustCookieCategory: string;
|
122
146
|
};
|
@@ -134,7 +158,7 @@ type KetchConsentPurpose = {
|
|
134
158
|
purpose: string;
|
135
159
|
};
|
136
160
|
|
137
|
-
type UserSessionKeys = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo';
|
161
|
+
type UserSessionKeys = 'userId' | 'userTraits' | 'anonymousId' | 'groupId' | 'groupTraits' | 'initialReferrer' | 'initialReferringDomain' | 'sessionInfo' | 'authToken';
|
138
162
|
|
139
163
|
type StorageEncryptionVersion = 'legacy' | 'v3';
|
140
164
|
type StorageType = 'cookieStorage' | 'localStorage' | 'memoryStorage' | 'sessionStorage' | 'none';
|
@@ -271,36 +295,93 @@ type LoadOptions = {
|
|
271
295
|
transportMode?: EventsTransportMode;
|
272
296
|
};
|
273
297
|
|
274
|
-
type
|
275
|
-
|
298
|
+
type Address = {
|
299
|
+
city?: string;
|
300
|
+
City?: string;
|
301
|
+
country?: string;
|
302
|
+
Country?: string;
|
303
|
+
postalCode?: string;
|
304
|
+
state?: string;
|
305
|
+
State?: string;
|
306
|
+
street?: string;
|
307
|
+
};
|
308
|
+
type Company = {
|
309
|
+
name?: string;
|
310
|
+
id?: string;
|
311
|
+
industry?: string;
|
312
|
+
employee_count?: string;
|
313
|
+
plan?: string;
|
314
|
+
};
|
276
315
|
/**
|
277
|
-
*
|
316
|
+
* Represents a traits object in the Identify API
|
278
317
|
*/
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
318
|
+
type IdentifyTraits = {
|
319
|
+
id?: string;
|
320
|
+
userId?: string;
|
321
|
+
firstName?: string;
|
322
|
+
firstname?: string;
|
323
|
+
first_name?: string;
|
324
|
+
lastName?: string;
|
325
|
+
lastname?: string;
|
326
|
+
last_name?: string;
|
327
|
+
name?: string;
|
328
|
+
Name?: string;
|
329
|
+
age?: number;
|
330
|
+
email?: string;
|
331
|
+
Email?: string;
|
332
|
+
'E-mail'?: string;
|
333
|
+
phone?: string;
|
334
|
+
address?: string | Address;
|
335
|
+
birthday?: string;
|
336
|
+
company?: Company;
|
337
|
+
createdAt?: string;
|
338
|
+
description?: string;
|
339
|
+
gender?: string;
|
340
|
+
title?: string;
|
341
|
+
username?: string;
|
342
|
+
website?: string;
|
343
|
+
avatar?: string;
|
344
|
+
zip?: string | number;
|
345
|
+
state?: string;
|
346
|
+
State?: string;
|
347
|
+
dob?: string;
|
348
|
+
employed?: string | boolean;
|
349
|
+
education?: string;
|
350
|
+
married?: string | boolean;
|
351
|
+
customerType?: string | number;
|
352
|
+
euConsent?: string;
|
353
|
+
euConsentMessage?: string;
|
354
|
+
newEmail?: string;
|
355
|
+
tags?: string | string[];
|
356
|
+
removeTags?: string | string[];
|
357
|
+
prospect?: string | boolean;
|
358
|
+
doubleOptin?: string | boolean;
|
359
|
+
event_id?: string;
|
360
|
+
constructor?: Record<string, string>;
|
361
|
+
organization?: string;
|
362
|
+
region?: string;
|
363
|
+
anonymous?: string | boolean;
|
364
|
+
country?: string;
|
365
|
+
custom?: string;
|
366
|
+
ip?: string;
|
367
|
+
privateAttributeNames?: any;
|
368
|
+
secondary?: any;
|
369
|
+
customPageId?: string;
|
370
|
+
isRudderEvents?: boolean;
|
371
|
+
optOutType?: boolean | string | number;
|
372
|
+
groupType?: string | number;
|
373
|
+
anonymousId?: string | number;
|
374
|
+
ip_address?: string;
|
375
|
+
number?: string | number;
|
376
|
+
[index: string]: string | number | boolean | ApiObject | null | (string | number | boolean | null | ApiObject)[] | undefined;
|
377
|
+
};
|
297
378
|
|
298
379
|
type AnalyticsIdentifyMethod = {
|
299
|
-
(userId?: string, traits?: Nullable<
|
300
|
-
(userId: string, traits: Nullable<
|
380
|
+
(userId?: string, traits?: Nullable<IdentifyTraits>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
381
|
+
(userId: string, traits: Nullable<IdentifyTraits>, callback: ApiCallback): void;
|
301
382
|
(userId: string, callback: ApiCallback): void;
|
302
|
-
(traits: Nullable<
|
303
|
-
(traits: Nullable<
|
383
|
+
(traits: Nullable<IdentifyTraits>, options: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
384
|
+
(traits: Nullable<IdentifyTraits>, callback?: ApiCallback): void;
|
304
385
|
};
|
305
386
|
type AnalyticsPageMethod = {
|
306
387
|
(category?: string, name?: string, properties?: Nullable<ApiObject>, options?: Nullable<ApiOptions>, callback?: ApiCallback): void;
|
@@ -570,7 +651,7 @@ type TrackCallOptions = {
|
|
570
651
|
};
|
571
652
|
type IdentifyCallOptions = {
|
572
653
|
userId?: string | null;
|
573
|
-
traits?: Nullable<
|
654
|
+
traits?: Nullable<IdentifyTraits>;
|
574
655
|
options?: Nullable<ApiOptions>;
|
575
656
|
callback?: ApiCallback;
|
576
657
|
};
|
@@ -665,6 +746,7 @@ interface IUserSessionManager {
|
|
665
746
|
reset(resetAnonymousId?: boolean, noNewSessionStart?: boolean): void;
|
666
747
|
start(sessionId?: number): void;
|
667
748
|
end(): void;
|
749
|
+
setAuthToken(token: string): void;
|
668
750
|
}
|
669
751
|
|
670
752
|
type DestinationConnectionMode = 'hybrid' | 'cloud' | 'device';
|
@@ -925,6 +1007,10 @@ interface IAnalytics {
|
|
925
1007
|
* To fetch the current sessionId
|
926
1008
|
*/
|
927
1009
|
getSessionId(): Nullable<number>;
|
1010
|
+
/**
|
1011
|
+
* To set auth token
|
1012
|
+
*/
|
1013
|
+
setAuthToken(token: string): void;
|
928
1014
|
}
|
929
1015
|
|
930
1016
|
declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
@@ -970,7 +1056,7 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
970
1056
|
/**
|
971
1057
|
* Process identify arguments and forward to page call
|
972
1058
|
*/
|
973
|
-
identify(userId?: string | number | Nullable<
|
1059
|
+
identify(userId?: string | number | Nullable<IdentifyTraits>, traits?: Nullable<IdentifyTraits> | Nullable<ApiOptions> | ApiCallback, options?: Nullable<ApiOptions> | ApiCallback, callback?: ApiCallback): void;
|
974
1060
|
/**
|
975
1061
|
* Process alias arguments and forward to page call
|
976
1062
|
*/
|
@@ -989,6 +1075,7 @@ declare class RudderAnalytics implements IRudderAnalytics<IAnalytics> {
|
|
989
1075
|
startSession(sessionId?: number): void;
|
990
1076
|
endSession(): void;
|
991
1077
|
getSessionId(): Nullable<number>;
|
1078
|
+
setAuthToken(token: string): void;
|
992
1079
|
}
|
993
1080
|
//# sourceMappingURL=RudderAnalytics.d.ts.map
|
994
1081
|
|
@@ -1112,6 +1199,7 @@ type SessionState = {
|
|
1112
1199
|
readonly initialReferrer: Signal<string | undefined>;
|
1113
1200
|
readonly initialReferringDomain: Signal<string | undefined>;
|
1114
1201
|
readonly sessionInfo: Signal<SessionInfo>;
|
1202
|
+
readonly authToken: Signal<Nullable<string>>;
|
1115
1203
|
};
|
1116
1204
|
type SourceConfigState = Signal<Source | undefined>;
|
1117
1205
|
type StorageEntry = {
|
@@ -1163,4 +1251,14 @@ interface IRudderStackGlobals {
|
|
1163
1251
|
[key: string]: ExposedGlobals;
|
1164
1252
|
}
|
1165
1253
|
|
1254
|
+
declare global {
|
1255
|
+
interface Window {
|
1256
|
+
rudderanalytics: RudderAnalytics | PreloadedEventCall[];
|
1257
|
+
RudderStackGlobals: IRudderStackGlobals;
|
1258
|
+
rudderAnalyticsMount: () => void;
|
1259
|
+
rudderAnalyticsBuildType: 'legacy' | 'modern';
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
//# sourceMappingURL=index.d.ts.map
|
1263
|
+
|
1166
1264
|
export { type AnonymousIdOptions, type ApiCallback, type ApiObject, type ApiOptions, type BeaconQueueOpts, type CookieSameSite, type DestinationsQueueOpts, type IRudderStackGlobals, type IntegrationOpts, type LoadOptions, type LogLevel, type PluginName, type PreloadedEventCall, type QueueOpts, type ResidencyServerRegion, RudderAnalytics, type SessionOpts, type UaChTrackLevel };
|