@amplitude/analytics-react-native 0.0.1-dev.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/README.md +0 -0
- package/amplitude-react-native.podspec +21 -0
- package/android/build.gradle +61 -0
- package/android/gradle.properties +3 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/amplitude/reactnative/AmplitudeReactNativeModule.kt +36 -0
- package/android/src/main/java/com/amplitude/reactnative/AmplitudeReactNativePackage.java +28 -0
- package/android/src/main/java/com/amplitude/reactnative/AndroidContextProvider.kt +415 -0
- package/android/src/main/java/com/amplitude/reactnative/AndroidLogger.kt +56 -0
- package/android/src/main/java/com/amplitude/reactnative/Utils.kt +34 -0
- package/ios/AmplitudeReactNative-Bridging-Header.h +5 -0
- package/ios/AmplitudeReactNative.m +7 -0
- package/ios/AmplitudeReactNative.swift +29 -0
- package/ios/AmplitudeReactNative.xcodeproj/project.pbxproj +293 -0
- package/ios/AppleContextProvider.swift +219 -0
- package/lib/commonjs/attribution/campaign-parser.js +74 -0
- package/lib/commonjs/attribution/campaign-parser.js.map +1 -0
- package/lib/commonjs/attribution/campaign-tracker.js +133 -0
- package/lib/commonjs/attribution/campaign-tracker.js.map +1 -0
- package/lib/commonjs/attribution/constants.js +47 -0
- package/lib/commonjs/attribution/constants.js.map +1 -0
- package/lib/commonjs/config.js +257 -0
- package/lib/commonjs/config.js.map +1 -0
- package/lib/commonjs/constants.js +31 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/cookie-migration/index.js +74 -0
- package/lib/commonjs/cookie-migration/index.js.map +1 -0
- package/lib/commonjs/index.js +141 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/plugins/context.js +136 -0
- package/lib/commonjs/plugins/context.js.map +1 -0
- package/lib/commonjs/react-native-client.js +362 -0
- package/lib/commonjs/react-native-client.js.map +1 -0
- package/lib/commonjs/session-manager.js +114 -0
- package/lib/commonjs/session-manager.js.map +1 -0
- package/lib/commonjs/storage/cookie.js +124 -0
- package/lib/commonjs/storage/cookie.js.map +1 -0
- package/lib/commonjs/storage/local-storage.js +79 -0
- package/lib/commonjs/storage/local-storage.js.map +1 -0
- package/lib/commonjs/storage/utm-cookie.js +42 -0
- package/lib/commonjs/storage/utm-cookie.js.map +1 -0
- package/lib/commonjs/transports/fetch.js +34 -0
- package/lib/commonjs/transports/fetch.js.map +1 -0
- package/lib/commonjs/transports/send-beacon.js +43 -0
- package/lib/commonjs/transports/send-beacon.js.map +1 -0
- package/lib/commonjs/transports/xhr.js +54 -0
- package/lib/commonjs/transports/xhr.js.map +1 -0
- package/lib/commonjs/typings/browser-snippet.d.js +6 -0
- package/lib/commonjs/typings/browser-snippet.d.js.map +1 -0
- package/lib/commonjs/typings/ua-parser.d.js +2 -0
- package/lib/commonjs/typings/ua-parser.d.js.map +1 -0
- package/lib/commonjs/utils/cookie-name.js +23 -0
- package/lib/commonjs/utils/cookie-name.js.map +1 -0
- package/lib/commonjs/utils/language.js +18 -0
- package/lib/commonjs/utils/language.js.map +1 -0
- package/lib/commonjs/utils/platform.js +21 -0
- package/lib/commonjs/utils/platform.js.map +1 -0
- package/lib/commonjs/utils/query-params.js +36 -0
- package/lib/commonjs/utils/query-params.js.map +1 -0
- package/lib/commonjs/utils/snippet-helper.js +56 -0
- package/lib/commonjs/utils/snippet-helper.js.map +1 -0
- package/lib/commonjs/version.js +9 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/attribution/campaign-parser.js +62 -0
- package/lib/module/attribution/campaign-parser.js.map +1 -0
- package/lib/module/attribution/campaign-tracker.js +120 -0
- package/lib/module/attribution/campaign-tracker.js.map +1 -0
- package/lib/module/attribution/constants.js +26 -0
- package/lib/module/attribution/constants.js.map +1 -0
- package/lib/module/config.js +217 -0
- package/lib/module/config.js.map +1 -0
- package/lib/module/constants.js +13 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/cookie-migration/index.js +56 -0
- package/lib/module/cookie-migration/index.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/plugins/context.js +118 -0
- package/lib/module/plugins/context.js.map +1 -0
- package/lib/module/react-native-client.js +329 -0
- package/lib/module/react-native-client.js.map +1 -0
- package/lib/module/session-manager.js +104 -0
- package/lib/module/session-manager.js.map +1 -0
- package/lib/module/storage/cookie.js +114 -0
- package/lib/module/storage/cookie.js.map +1 -0
- package/lib/module/storage/local-storage.js +67 -0
- package/lib/module/storage/local-storage.js.map +1 -0
- package/lib/module/storage/utm-cookie.js +32 -0
- package/lib/module/storage/utm-cookie.js.map +1 -0
- package/lib/module/transports/fetch.js +24 -0
- package/lib/module/transports/fetch.js.map +1 -0
- package/lib/module/transports/send-beacon.js +33 -0
- package/lib/module/transports/send-beacon.js.map +1 -0
- package/lib/module/transports/xhr.js +44 -0
- package/lib/module/transports/xhr.js.map +1 -0
- package/lib/module/typings/browser-snippet.d.js +2 -0
- package/lib/module/typings/browser-snippet.d.js.map +1 -0
- package/lib/module/typings/ua-parser.d.js +2 -0
- package/lib/module/typings/ua-parser.d.js.map +1 -0
- package/lib/module/utils/cookie-name.js +10 -0
- package/lib/module/utils/cookie-name.js.map +1 -0
- package/lib/module/utils/language.js +9 -0
- package/lib/module/utils/language.js.map +1 -0
- package/lib/module/utils/platform.js +8 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/query-params.js +26 -0
- package/lib/module/utils/query-params.js.map +1 -0
- package/lib/module/utils/snippet-helper.js +41 -0
- package/lib/module/utils/snippet-helper.js.map +1 -0
- package/lib/module/version.js +2 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/attribution/campaign-parser.d.ts +10 -0
- package/lib/typescript/attribution/campaign-parser.d.ts.map +1 -0
- package/lib/typescript/attribution/campaign-tracker.d.ts +72 -0
- package/lib/typescript/attribution/campaign-tracker.d.ts.map +1 -0
- package/lib/typescript/attribution/constants.d.ts +17 -0
- package/lib/typescript/attribution/constants.d.ts.map +1 -0
- package/lib/typescript/config.d.ts +90 -0
- package/lib/typescript/config.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +13 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/cookie-migration/index.d.ts +5 -0
- package/lib/typescript/cookie-migration/index.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +6 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/plugins/context.d.ts +31 -0
- package/lib/typescript/plugins/context.d.ts.map +1 -0
- package/lib/typescript/react-native-client.d.ts +209 -0
- package/lib/typescript/react-native-client.d.ts.map +1 -0
- package/lib/typescript/session-manager.d.ts +28 -0
- package/lib/typescript/session-manager.d.ts.map +1 -0
- package/lib/typescript/storage/cookie.d.ts +12 -0
- package/lib/typescript/storage/cookie.d.ts.map +1 -0
- package/lib/typescript/storage/local-storage.d.ts +10 -0
- package/lib/typescript/storage/local-storage.d.ts.map +1 -0
- package/lib/typescript/storage/utm-cookie.d.ts +6 -0
- package/lib/typescript/storage/utm-cookie.d.ts.map +1 -0
- package/lib/typescript/transports/fetch.d.ts +6 -0
- package/lib/typescript/transports/fetch.d.ts.map +1 -0
- package/lib/typescript/transports/send-beacon.d.ts +6 -0
- package/lib/typescript/transports/send-beacon.d.ts.map +1 -0
- package/lib/typescript/transports/xhr.d.ts +7 -0
- package/lib/typescript/transports/xhr.d.ts.map +1 -0
- package/lib/typescript/utils/cookie-name.d.ts +3 -0
- package/lib/typescript/utils/cookie-name.d.ts.map +1 -0
- package/lib/typescript/utils/language.d.ts +2 -0
- package/lib/typescript/utils/language.d.ts.map +1 -0
- package/lib/typescript/utils/platform.d.ts +3 -0
- package/lib/typescript/utils/platform.d.ts.map +1 -0
- package/lib/typescript/utils/query-params.d.ts +2 -0
- package/lib/typescript/utils/query-params.d.ts.map +1 -0
- package/lib/typescript/utils/snippet-helper.d.ts +16 -0
- package/lib/typescript/utils/snippet-helper.d.ts.map +1 -0
- package/lib/typescript/version.d.ts +2 -0
- package/lib/typescript/version.d.ts.map +1 -0
- package/package.json +93 -0
- package/src/attribution/campaign-parser.ts +78 -0
- package/src/attribution/campaign-tracker.ts +112 -0
- package/src/attribution/constants.ts +32 -0
- package/src/config.ts +210 -0
- package/src/constants.ts +14 -0
- package/src/cookie-migration/index.ts +54 -0
- package/src/index.ts +23 -0
- package/src/plugins/context.ts +106 -0
- package/src/react-native-client.ts +349 -0
- package/src/session-manager.ts +81 -0
- package/src/storage/cookie.ts +95 -0
- package/src/storage/local-storage.ts +67 -0
- package/src/storage/utm-cookie.ts +27 -0
- package/src/transports/fetch.ts +23 -0
- package/src/transports/send-beacon.ts +34 -0
- package/src/transports/xhr.ts +36 -0
- package/src/typings/browser-snippet.d.ts +7 -0
- package/src/typings/ua-parser.d.ts +4 -0
- package/src/utils/cookie-name.ts +9 -0
- package/src/utils/language.ts +7 -0
- package/src/utils/platform.ts +9 -0
- package/src/utils/query-params.ts +21 -0
- package/src/utils/snippet-helper.ts +35 -0
- package/src/version.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-parser.d.ts","sourceRoot":"","sources":["../../../src/attribution/campaign-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAiBlD,OAAO,EACL,QAAQ,EACR,cAAc,IAAI,eAAe,EACjC,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,cAAe,YAAW,eAAe;IACpD,gBAAgB,YAAmB;IAE7B,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC;IAS1B,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC;IAmB3C,WAAW,IAAI,kBAAkB;IAcjC,WAAW,IAAI,iBAAiB;CAOjC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Storage, Campaign, CampaignParser as ICampaignParser, CampaignTracker as ICampaignTracker, CampaignTrackFunction, CampaignTrackerOptions } from '@amplitude/analytics-types';
|
|
2
|
+
export declare class CampaignTracker implements ICampaignTracker {
|
|
3
|
+
storage: Storage<Campaign>;
|
|
4
|
+
storageKey: string;
|
|
5
|
+
parser: ICampaignParser;
|
|
6
|
+
track: CampaignTrackFunction;
|
|
7
|
+
onNewCampaign: (campaign: Campaign) => unknown;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
trackNewCampaigns: boolean;
|
|
10
|
+
trackPageViews: boolean;
|
|
11
|
+
excludeReferrers: string[];
|
|
12
|
+
initialEmptyValue: string;
|
|
13
|
+
constructor(apiKey: string, options: CampaignTrackerOptions);
|
|
14
|
+
isNewCampaign(currentCampaign: Campaign, previousCampaign: Campaign): boolean;
|
|
15
|
+
saveCampaignToStorage(campaign: Campaign): Promise<void>;
|
|
16
|
+
getCampaignFromStorage(): Promise<Campaign>;
|
|
17
|
+
createCampaignEvent(campaign: Campaign): {
|
|
18
|
+
event_type: string;
|
|
19
|
+
event_properties?: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
} | undefined;
|
|
22
|
+
user_properties: {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
} | import("@amplitude/analytics-types").IdentifyUserProperties | {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
};
|
|
27
|
+
group_properties?: {
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
} | undefined;
|
|
30
|
+
groups?: {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
} | undefined;
|
|
33
|
+
user_id?: string | undefined;
|
|
34
|
+
device_id?: string | undefined;
|
|
35
|
+
time?: number | undefined;
|
|
36
|
+
location_lat?: number | undefined;
|
|
37
|
+
location_lng?: number | undefined;
|
|
38
|
+
app_version?: string | undefined;
|
|
39
|
+
version_name?: string | undefined;
|
|
40
|
+
library?: string | undefined;
|
|
41
|
+
platform?: string | undefined;
|
|
42
|
+
os_name?: string | undefined;
|
|
43
|
+
os_version?: string | undefined;
|
|
44
|
+
device_brand?: string | undefined;
|
|
45
|
+
device_manufacturer?: string | undefined;
|
|
46
|
+
device_model?: string | undefined;
|
|
47
|
+
carrier?: string | undefined;
|
|
48
|
+
country?: string | undefined;
|
|
49
|
+
region?: string | undefined;
|
|
50
|
+
city?: string | undefined;
|
|
51
|
+
dma?: string | undefined;
|
|
52
|
+
idfa?: string | undefined;
|
|
53
|
+
idfv?: string | undefined;
|
|
54
|
+
adid?: string | undefined;
|
|
55
|
+
android_id?: string | undefined;
|
|
56
|
+
language?: string | undefined;
|
|
57
|
+
ip?: string | undefined;
|
|
58
|
+
uuid?: string | undefined;
|
|
59
|
+
price?: number | undefined;
|
|
60
|
+
quantity?: number | undefined;
|
|
61
|
+
revenue?: number | undefined;
|
|
62
|
+
productId?: string | undefined;
|
|
63
|
+
revenueType?: string | undefined;
|
|
64
|
+
event_id?: number | undefined;
|
|
65
|
+
session_id?: number | undefined;
|
|
66
|
+
insert_id?: string | undefined;
|
|
67
|
+
plan?: import("@amplitude/analytics-types").Plan | undefined;
|
|
68
|
+
partner_id?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
send(isNewSession: boolean): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=campaign-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaign-tracker.d.ts","sourceRoot":"","sources":["../../../src/attribution/campaign-tracker.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,QAAQ,EACR,cAAc,IAAI,eAAe,EACjC,eAAe,IAAI,gBAAgB,EACnC,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,4BAA4B,CAAC;AAKpC,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,aAAa,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC;IAE/C,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;gBAEd,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB;IAiB3D,aAAa,CAAC,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ;IAe7D,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxD,sBAAsB,IAAI,OAAO,CAAC,QAAQ,CAAC;IAIjD,mBAAmB,CAAC,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BhC,IAAI,CAAC,YAAY,EAAE,OAAO;CAejC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Campaign } from '@amplitude/analytics-types';
|
|
2
|
+
export declare const UTM_SOURCE = "utm_source";
|
|
3
|
+
export declare const UTM_MEDIUM = "utm_medium";
|
|
4
|
+
export declare const UTM_CAMPAIGN = "utm_campaign";
|
|
5
|
+
export declare const UTM_TERM = "utm_term";
|
|
6
|
+
export declare const UTM_CONTENT = "utm_content";
|
|
7
|
+
export declare const UTMZ_SOURCE = "utmcsr";
|
|
8
|
+
export declare const UTMZ_MEDIUM = "utmcmd";
|
|
9
|
+
export declare const UTMZ_CAMPAIGN = "utmccn";
|
|
10
|
+
export declare const UTMZ_TERM = "utmctr";
|
|
11
|
+
export declare const UTMZ_CONTENT = "utmcct";
|
|
12
|
+
export declare const GCLID = "gclid";
|
|
13
|
+
export declare const FBCLID = "fbclid";
|
|
14
|
+
export declare const EMPTY_VALUE = "EMPTY";
|
|
15
|
+
export declare const BASE_CAMPAIGN: Campaign;
|
|
16
|
+
export declare const MKTG = "MKTG";
|
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/attribution/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,eAAO,MAAM,aAAa,EAAE,QAU3B,CAAC;AAEF,eAAO,MAAM,IAAI,SAAS,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Event, ReactNativeOptions, ReactNativeConfig as IReactNativeConfig, Storage, TrackingOptions, TransportType, UserSession, SessionManager as ISessionManager } from '@amplitude/analytics-types';
|
|
2
|
+
import { Config, MemoryStorage } from '@amplitude/analytics-core';
|
|
3
|
+
import { FetchTransport } from './transports/fetch';
|
|
4
|
+
import { XHRTransport } from './transports/xhr';
|
|
5
|
+
import { SendBeaconTransport } from './transports/send-beacon';
|
|
6
|
+
import { SessionManager } from './session-manager';
|
|
7
|
+
export declare const getDefaultConfig: () => {
|
|
8
|
+
cookieExpiration: number;
|
|
9
|
+
cookieSameSite: string;
|
|
10
|
+
cookieSecure: boolean;
|
|
11
|
+
cookieStorage: MemoryStorage<UserSession>;
|
|
12
|
+
disableCookies: boolean;
|
|
13
|
+
domain: string;
|
|
14
|
+
sessionManager: SessionManager;
|
|
15
|
+
sessionTimeout: number;
|
|
16
|
+
storageProvider: MemoryStorage<Event[]>;
|
|
17
|
+
trackingOptions: {
|
|
18
|
+
city: boolean;
|
|
19
|
+
country: boolean;
|
|
20
|
+
carrier: boolean;
|
|
21
|
+
deviceManufacturer: boolean;
|
|
22
|
+
deviceModel: boolean;
|
|
23
|
+
dma: boolean;
|
|
24
|
+
ipAddress: boolean;
|
|
25
|
+
language: boolean;
|
|
26
|
+
osName: boolean;
|
|
27
|
+
osVersion: boolean;
|
|
28
|
+
platform: boolean;
|
|
29
|
+
region: boolean;
|
|
30
|
+
versionName: boolean;
|
|
31
|
+
};
|
|
32
|
+
transportProvider: FetchTransport;
|
|
33
|
+
};
|
|
34
|
+
export declare class ReactNativeConfig extends Config implements IReactNativeConfig {
|
|
35
|
+
appVersion?: string;
|
|
36
|
+
cookieExpiration: number;
|
|
37
|
+
cookieSameSite: string;
|
|
38
|
+
cookieSecure: boolean;
|
|
39
|
+
cookieStorage: Storage<UserSession>;
|
|
40
|
+
disableCookies: boolean;
|
|
41
|
+
domain: string;
|
|
42
|
+
partnerId?: string;
|
|
43
|
+
sessionTimeout: number;
|
|
44
|
+
trackingOptions: TrackingOptions;
|
|
45
|
+
sessionManager: ISessionManager;
|
|
46
|
+
constructor(apiKey: string, userId?: string, options?: ReactNativeOptions);
|
|
47
|
+
get deviceId(): string | undefined;
|
|
48
|
+
set deviceId(deviceId: string | undefined);
|
|
49
|
+
get userId(): string | undefined;
|
|
50
|
+
set userId(userId: string | undefined);
|
|
51
|
+
get sessionId(): number | undefined;
|
|
52
|
+
set sessionId(sessionId: number | undefined);
|
|
53
|
+
get optOut(): boolean;
|
|
54
|
+
set optOut(optOut: boolean);
|
|
55
|
+
get lastEventTime(): number | undefined;
|
|
56
|
+
set lastEventTime(lastEventTime: number | undefined);
|
|
57
|
+
}
|
|
58
|
+
export declare const useReactNativeConfig: (apiKey: string, userId?: string | undefined, options?: ReactNativeOptions | undefined) => Promise<IReactNativeConfig>;
|
|
59
|
+
export declare const createCookieStorage: (overrides?: ReactNativeOptions | undefined, baseConfig?: {
|
|
60
|
+
cookieExpiration: number;
|
|
61
|
+
cookieSameSite: string;
|
|
62
|
+
cookieSecure: boolean;
|
|
63
|
+
cookieStorage: MemoryStorage<UserSession>;
|
|
64
|
+
disableCookies: boolean;
|
|
65
|
+
domain: string;
|
|
66
|
+
sessionManager: SessionManager;
|
|
67
|
+
sessionTimeout: number;
|
|
68
|
+
storageProvider: MemoryStorage<Event[]>;
|
|
69
|
+
trackingOptions: {
|
|
70
|
+
city: boolean;
|
|
71
|
+
country: boolean;
|
|
72
|
+
carrier: boolean;
|
|
73
|
+
deviceManufacturer: boolean;
|
|
74
|
+
deviceModel: boolean;
|
|
75
|
+
dma: boolean;
|
|
76
|
+
ipAddress: boolean;
|
|
77
|
+
language: boolean;
|
|
78
|
+
osName: boolean;
|
|
79
|
+
osVersion: boolean;
|
|
80
|
+
platform: boolean;
|
|
81
|
+
region: boolean;
|
|
82
|
+
versionName: boolean;
|
|
83
|
+
};
|
|
84
|
+
transportProvider: FetchTransport;
|
|
85
|
+
}) => Promise<Storage<UserSession>>;
|
|
86
|
+
export declare const createFlexibleStorage: <T>(options: ReactNativeOptions) => Promise<Storage<T>>;
|
|
87
|
+
export declare const createEventsStorage: (overrides?: ReactNativeOptions | undefined) => Promise<Storage<Event[]>>;
|
|
88
|
+
export declare const createDeviceId: (idFromCookies?: string | undefined, idFromOptions?: string | undefined, idFromQueryParams?: string | undefined) => string;
|
|
89
|
+
export declare const createTransport: (transport?: TransportType | undefined) => FetchTransport | XHRTransport | SendBeaconTransport;
|
|
90
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,iBAAiB,IAAI,kBAAkB,EACvC,OAAO,EACP,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,IAAI,eAAe,EAClC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAQ,MAAM,2BAA2B,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B5B,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,MAAO,YAAW,kBAAkB;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,eAAe,CAAC;gBAEpB,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB;IA2BzE,IAAI,QAAQ,IAIW,MAAM,GAAG,SAAS,CAFxC;IAED,IAAI,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAExC;IAED,IAAI,MAAM,IAIS,MAAM,GAAG,SAAS,CAFpC;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAEpC;IAED,IAAI,SAAS,IAIY,MAAM,GAAG,SAAS,CAF1C;IAED,IAAI,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAE1C;IAED,IAAI,MAAM,IAIS,OAAO,CAFzB;IAED,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAEzB;IAED,IAAI,aAAa,IAIgB,MAAM,GAAG,SAAS,CAFlD;IAED,IAAI,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,EAElD;CACF;AAED,eAAO,MAAM,oBAAoB,WACvB,MAAM,4EAGb,QAAQ,kBAAkB,CAmB5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;MAG7B,QAAQ,QAAQ,WAAW,CAAC,CAO9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAsB,kBAAkB,wBAczE,CAAC;AAEF,eAAO,MAAM,mBAAmB,kDAA2C,QAAQ,QAAQ,KAAK,EAAE,CAAC,CASlG,CAAC;AAEF,eAAO,MAAM,cAAc,4HAE1B,CAAC;AAEF,eAAO,MAAM,eAAe,gGAQ3B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const UTM_SOURCE = "utm_source";
|
|
2
|
+
export declare const UTM_MEDIUM = "utm_medium";
|
|
3
|
+
export declare const UTM_CAMPAIGN = "utm_campaign";
|
|
4
|
+
export declare const UTM_TERM = "utm_term";
|
|
5
|
+
export declare const UTM_CONTENT = "utm_content";
|
|
6
|
+
export declare const UTMZ_SOURCE = "utmcsr";
|
|
7
|
+
export declare const UTMZ_MEDIUM = "utmcmd";
|
|
8
|
+
export declare const UTMZ_CAMPAIGN = "utmccn";
|
|
9
|
+
export declare const UTMZ_TERM = "utmctr";
|
|
10
|
+
export declare const UTMZ_CONTENT = "utmcct";
|
|
11
|
+
export declare const GCLID = "gclid";
|
|
12
|
+
export declare const FBCLID = "fbclid";
|
|
13
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,UAAU,eAAe,CAAC;AACvC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAEzC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,aAAa,WAAW,CAAC;AACtC,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BrowserOptions, UserSession } from '@amplitude/analytics-types';
|
|
2
|
+
export declare const parseOldCookies: (apiKey: string, options?: BrowserOptions | undefined) => Promise<UserSession>;
|
|
3
|
+
export declare const parseTime: (num: string) => number | undefined;
|
|
4
|
+
export declare const decode: (value?: string | undefined) => string | undefined;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cookie-migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAW,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAKlF,eAAO,MAAM,eAAe,WAAkB,MAAM,2CAA6B,QAAQ,WAAW,CA6BnG,CAAC;AAEF,eAAO,MAAM,SAAS,QAAS,MAAM,uBAMpC,CAAC;AAEF,eAAO,MAAM,MAAM,kCAAqB,MAAM,GAAG,SAShD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { add, getDeviceId, getSessionId, getUserId, groupIdentify, identify, init, logEvent, remove, revenue, setDeviceId, setGroup, setOptOut, setSessionId, setTransport, setUserId, track, } from './react-native-client';
|
|
2
|
+
export { runQueuedFunctions } from './utils/snippet-helper';
|
|
3
|
+
export { Revenue, Identify } from '@amplitude/analytics-core';
|
|
4
|
+
import * as Types from '@amplitude/analytics-types';
|
|
5
|
+
export { Types };
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,GACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BeforePlugin, ReactNativeConfig, Event, PluginType } from '@amplitude/analytics-types';
|
|
2
|
+
import UAParser from '@amplitude/ua-parser-js';
|
|
3
|
+
declare type NativeContext = {
|
|
4
|
+
version: string;
|
|
5
|
+
platform: string;
|
|
6
|
+
language: string;
|
|
7
|
+
os_name: string;
|
|
8
|
+
os_version: string;
|
|
9
|
+
device_brand: string;
|
|
10
|
+
device_manufacturer: string;
|
|
11
|
+
device_model: string;
|
|
12
|
+
carrier: string;
|
|
13
|
+
};
|
|
14
|
+
export interface AmplitudeReactNative {
|
|
15
|
+
getApplicationContext(): Promise<NativeContext>;
|
|
16
|
+
}
|
|
17
|
+
export declare class Context implements BeforePlugin {
|
|
18
|
+
name: string;
|
|
19
|
+
type: PluginType.BEFORE;
|
|
20
|
+
config: ReactNativeConfig;
|
|
21
|
+
eventId: number;
|
|
22
|
+
uaResult: UAParser.IResult;
|
|
23
|
+
nativeModule: AmplitudeReactNative | undefined;
|
|
24
|
+
library: string;
|
|
25
|
+
constructor();
|
|
26
|
+
setup(config: ReactNativeConfig): Promise<undefined>;
|
|
27
|
+
execute(context: Event): Promise<Event>;
|
|
28
|
+
isSessionValid(): boolean;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/plugins/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAS/C,aAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,qBAAqB,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CACjD;AAED,qBAAa,OAAQ,YAAW,YAAY;IAC1C,IAAI,SAAa;IACjB,IAAI,oBAA8B;IAKlC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,SAAK;IACZ,QAAQ,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3B,YAAY,EAAE,oBAAoB,GAAG,SAAS,CAEhC;IACd,OAAO,SAA6B;;IAWpC,KAAK,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;IAK9C,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IA6C7C,cAAc;CAKf"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { AmplitudeCore } from '@amplitude/analytics-core';
|
|
2
|
+
import { ReactNativeConfig, EventOptions, Identify as IIdentify, Result, Revenue as IRevenue, TransportType, ReactNativeOptions, AdditionalReactNativeOptions, AttributionReactNativeOptions } from '@amplitude/analytics-types';
|
|
3
|
+
export declare class AmplitudeReactNative extends AmplitudeCore<ReactNativeConfig> {
|
|
4
|
+
init(apiKey: string, userId?: string, options?: ReactNativeOptions & AdditionalReactNativeOptions): Promise<void>;
|
|
5
|
+
runAttributionStrategy(attributionConfig?: AttributionReactNativeOptions, isNewSession?: boolean): Promise<void>;
|
|
6
|
+
getUserId(): string | undefined;
|
|
7
|
+
setUserId(userId: string | undefined): void;
|
|
8
|
+
getDeviceId(): string | undefined;
|
|
9
|
+
setDeviceId(deviceId: string): void;
|
|
10
|
+
regenerateDeviceId(): void;
|
|
11
|
+
getSessionId(): number | undefined;
|
|
12
|
+
setSessionId(sessionId: number): void;
|
|
13
|
+
setOptOut(optOut: boolean): void;
|
|
14
|
+
setTransport(transport: TransportType): void;
|
|
15
|
+
identify(identify: IIdentify, eventOptions?: EventOptions): Promise<Result>;
|
|
16
|
+
groupIdentify(groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions): Promise<Result>;
|
|
17
|
+
revenue(revenue: IRevenue, eventOptions?: EventOptions): Promise<Result>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Initializes the Amplitude SDK with your apiKey, userId and optional configurations.
|
|
21
|
+
* This method must be called before any other operations.
|
|
22
|
+
*
|
|
23
|
+
* ```typescript
|
|
24
|
+
* await init(API_KEY, USER_ID, options).promise;
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const init: (apiKey: string, userId?: string | undefined, options?: (ReactNativeOptions & AdditionalReactNativeOptions) | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Adds a new plugin.
|
|
30
|
+
*
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const plugin = {...};
|
|
33
|
+
* amplitude.add(plugin);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const add: (plugin: import("@amplitude/analytics-types").Plugin) => import("@amplitude/analytics-types").AmplitudeReturn<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Removes a plugin.
|
|
39
|
+
*
|
|
40
|
+
* ```typescript
|
|
41
|
+
* amplitude.remove('myPlugin');
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const remove: (pluginName: string) => import("@amplitude/analytics-types").AmplitudeReturn<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Tracks user-defined event, with specified type, optional event properties and optional overwrites.
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // event tracking with event type only
|
|
50
|
+
* track('Page Load');
|
|
51
|
+
*
|
|
52
|
+
* // event tracking with event type and additional event properties
|
|
53
|
+
* track('Page Load', { loadTime: 1000 });
|
|
54
|
+
*
|
|
55
|
+
* // event tracking with event type, additional event properties, and overwritten event options
|
|
56
|
+
* track('Page Load', { loadTime: 1000 }, { sessionId: -1 });
|
|
57
|
+
*
|
|
58
|
+
* // alternatively, this tracking method is awaitable
|
|
59
|
+
* const result = await track('Page Load').promise;
|
|
60
|
+
* console.log(result.event); // {...}
|
|
61
|
+
* console.log(result.code); // 200
|
|
62
|
+
* console.log(result.message); // "Event tracked successfully"
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const track: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
66
|
+
/**
|
|
67
|
+
* Alias for track()
|
|
68
|
+
*/
|
|
69
|
+
export declare const logEvent: (eventInput: string | import("@amplitude/analytics-types").BaseEvent, eventProperties?: Record<string, any> | undefined, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
70
|
+
/**
|
|
71
|
+
* Sends an identify event containing user property operations
|
|
72
|
+
*
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const id = new Identify();
|
|
75
|
+
* id.set('colors', ['rose', 'gold']);
|
|
76
|
+
* identify(id);
|
|
77
|
+
*
|
|
78
|
+
* // alternatively, this tracking method is awaitable
|
|
79
|
+
* const result = await identify(id).promise;
|
|
80
|
+
* console.log(result.event); // {...}
|
|
81
|
+
* console.log(result.code); // 200
|
|
82
|
+
* console.log(result.message); // "Event tracked successfully"
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare const identify: (identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
86
|
+
/**
|
|
87
|
+
* Sends a group identify event containing group property operations.
|
|
88
|
+
*
|
|
89
|
+
* ```typescript
|
|
90
|
+
* const id = new Identify();
|
|
91
|
+
* id.set('skills', ['js', 'ts']);
|
|
92
|
+
* const groupType = 'org';
|
|
93
|
+
* const groupName = 'engineering';
|
|
94
|
+
* groupIdentify(groupType, groupName, id);
|
|
95
|
+
*
|
|
96
|
+
* // alternatively, this tracking method is awaitable
|
|
97
|
+
* const result = await groupIdentify(groupType, groupName, id).promise;
|
|
98
|
+
* console.log(result.event); // {...}
|
|
99
|
+
* console.log(result.code); // 200
|
|
100
|
+
* console.log(result.message); // "Event tracked successfully"
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare const groupIdentify: (groupType: string, groupName: string | string[], identify: IIdentify, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
104
|
+
export declare const setGroup: (groupType: string, groupName: string | string[]) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
105
|
+
/**
|
|
106
|
+
* Sends a revenue event containing revenue property operations.
|
|
107
|
+
*
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const rev = new Revenue();
|
|
110
|
+
* rev.setRevenue(100);
|
|
111
|
+
* revenue(rev);
|
|
112
|
+
*
|
|
113
|
+
* // alternatively, this tracking method is awaitable
|
|
114
|
+
* const result = await revenue(rev).promise;
|
|
115
|
+
* console.log(result.event); // {...}
|
|
116
|
+
* console.log(result.code); // 200
|
|
117
|
+
* console.log(result.message); // "Event tracked successfully"
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare const revenue: (revenue: IRevenue, eventOptions?: EventOptions | undefined) => import("@amplitude/analytics-types").AmplitudeReturn<Result>;
|
|
121
|
+
/**
|
|
122
|
+
* Returns current user ID.
|
|
123
|
+
*
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const userId = getUserId();
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare const getUserId: () => string | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Sets a new user ID.
|
|
131
|
+
*
|
|
132
|
+
* ```typescript
|
|
133
|
+
* setUserId('userId');
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare const setUserId: (userId: string | undefined) => void;
|
|
137
|
+
/**
|
|
138
|
+
* Returns current device ID.
|
|
139
|
+
*
|
|
140
|
+
* ```typescript
|
|
141
|
+
* const deviceId = getDeviceId();
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare const getDeviceId: () => string | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Sets a new device ID.
|
|
147
|
+
* When setting a custom device ID, make sure the value is sufficiently unique.
|
|
148
|
+
* A uuid is recommended.
|
|
149
|
+
*
|
|
150
|
+
* ```typescript
|
|
151
|
+
* setDeviceId('deviceId');
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export declare const setDeviceId: (deviceId: string) => void;
|
|
155
|
+
/**
|
|
156
|
+
* Regenerates a new random deviceId for current user. Note: this is not recommended unless you know what you
|
|
157
|
+
* are doing. This can be used in conjunction with `setUserId(undefined)` to anonymize users after they log out.
|
|
158
|
+
* With an `unefined` userId and a completely new deviceId, the current user would appear as a brand new user in dashboard.
|
|
159
|
+
*
|
|
160
|
+
* ```typescript
|
|
161
|
+
* regenerateDeviceId();
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare const regenerateDeviceId: () => void;
|
|
165
|
+
/**
|
|
166
|
+
* Returns current session ID.
|
|
167
|
+
*
|
|
168
|
+
* ```typescript
|
|
169
|
+
* const sessionId = getSessionId();
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare const getSessionId: () => number | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Sets a new session ID.
|
|
175
|
+
* When settign a custom session ID, make sure the value is in milliseconds since epoch (Unix Timestamp).
|
|
176
|
+
*
|
|
177
|
+
* ```typescript
|
|
178
|
+
* setSessionId(Date.now());
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export declare const setSessionId: (sessionId: number) => void;
|
|
182
|
+
/**
|
|
183
|
+
* Sets a new optOut config value. This toggles event tracking on/off.
|
|
184
|
+
*
|
|
185
|
+
*```typescript
|
|
186
|
+
* // Stops tracking
|
|
187
|
+
* setOptOut(true);
|
|
188
|
+
*
|
|
189
|
+
* // Starts/resumes tracking
|
|
190
|
+
* setOptOut(false);
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export declare const setOptOut: (optOut: boolean) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Sets the network transport type for events.
|
|
196
|
+
*
|
|
197
|
+
* ```typescript
|
|
198
|
+
* // Use Fetch API
|
|
199
|
+
* setTransport('fetch');
|
|
200
|
+
*
|
|
201
|
+
* // Use XMLHttpRequest API
|
|
202
|
+
* setTransport('xhr');
|
|
203
|
+
*
|
|
204
|
+
* // Use navigator.sendBeacon API
|
|
205
|
+
* setTransport('beacon');
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export declare const setTransport: (transport: TransportType) => void;
|
|
209
|
+
//# sourceMappingURL=react-native-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-native-client.d.ts","sourceRoot":"","sources":["../../src/react-native-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiD,MAAM,2BAA2B,CAAC;AACzG,OAAO,EACL,iBAAiB,EAEjB,YAAY,EACZ,QAAQ,IAAI,SAAS,EACrB,MAAM,EACN,OAAO,IAAI,QAAQ,EACnB,aAAa,EACb,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,4BAA4B,CAAC;AAOpC,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IAClE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,4BAA4B;IAoCjG,sBAAsB,CAAC,iBAAiB,CAAC,EAAE,6BAA6B,EAAE,YAAY,UAAQ;IAepG,SAAS;IAIT,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS;IAIpC,WAAW;IAIX,WAAW,CAAC,QAAQ,EAAE,MAAM;IAI5B,kBAAkB;IAKlB,YAAY;IAIZ,YAAY,CAAC,SAAS,EAAE,MAAM;IAI9B,SAAS,CAAC,MAAM,EAAE,OAAO;IAIzB,YAAY,CAAC,SAAS,EAAE,aAAa;IAIrC,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAS3E,aAAa,CACX,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,SAAS,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,MAAM,CAAC;IASlB,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,YAAY;CAQvD;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,wLAA0C,CAAC;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,qHAAyC,CAAC;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,oFAA4C,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,KAAK,mOAA2C,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,QAAQ,mOAA8C,CAAC;AAEpE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,gIAA8C,CAAC;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,iLAAmD,CAAC;AAC9E,eAAO,MAAM,QAAQ,mHAA8C,CAAC;AAEpE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO,8HAA6C,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,0BAAgC,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,WAlMF,MAAM,GAAG,SAAS,SAkMgB,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,0BAAkC,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,aA9MA,MAAM,SA8M4B,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,YAAyC,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,0BAAmC,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,cA/NC,MAAM,SA+N4B,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,WAxOF,OAAO,SAwO2B,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,cApPC,aAAa,SAoPqB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UserSession, Storage, SessionManager as ISessionManager } from '@amplitude/analytics-types';
|
|
2
|
+
export declare class SessionManager implements ISessionManager {
|
|
3
|
+
private storage;
|
|
4
|
+
storageKey: string;
|
|
5
|
+
cache: UserSession;
|
|
6
|
+
isSessionCacheValid: boolean;
|
|
7
|
+
constructor(storage: Storage<UserSession>, apiKey: string);
|
|
8
|
+
/**
|
|
9
|
+
* load() must be called immediately after instantation
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* await new SessionManager(...).load();
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
load(): Promise<this>;
|
|
16
|
+
setSession(session: Partial<UserSession>): void;
|
|
17
|
+
getSessionId(): number | undefined;
|
|
18
|
+
setSessionId(sessionId: number): void;
|
|
19
|
+
getDeviceId(): string | undefined;
|
|
20
|
+
setDeviceId(deviceId: string): void;
|
|
21
|
+
getUserId(): string | undefined;
|
|
22
|
+
setUserId(userId: string): void;
|
|
23
|
+
getLastEventTime(): number | undefined;
|
|
24
|
+
setLastEventTime(lastEventTime: number): void;
|
|
25
|
+
getOptOut(): boolean;
|
|
26
|
+
setOptOut(optOut: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=session-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../src/session-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGrG,qBAAa,cAAe,YAAW,eAAe;IAKxC,OAAO,CAAC,OAAO;IAJ3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,WAAW,CAAC;IACnB,mBAAmB,UAAQ;gBAEP,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM;IAKjE;;;;;;OAMG;IACG,IAAI;IAOV,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;IAKxC,YAAY;IAWZ,YAAY,CAAC,SAAS,EAAE,MAAM;IAM9B,WAAW,IAAI,MAAM,GAAG,SAAS;IAIjC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,SAAS,IAAI,MAAM,GAAG,SAAS;IAI/B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B,gBAAgB;IAIhB,gBAAgB,CAAC,aAAa,EAAE,MAAM;IAItC,SAAS,IAAI,OAAO;IAIpB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;CAGjC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Storage, CookieStorageOptions } from '@amplitude/analytics-types';
|
|
2
|
+
export declare class CookieStorage<T> implements Storage<T> {
|
|
3
|
+
options: CookieStorageOptions;
|
|
4
|
+
constructor(options?: CookieStorageOptions);
|
|
5
|
+
isEnabled(): Promise<boolean>;
|
|
6
|
+
get(key: string): Promise<T | undefined>;
|
|
7
|
+
getRaw(key: string): Promise<string | undefined>;
|
|
8
|
+
set(key: string, value: T | null): Promise<void>;
|
|
9
|
+
remove(key: string): Promise<void>;
|
|
10
|
+
reset(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie.d.ts","sourceRoot":"","sources":["../../../src/storage/cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAG3E,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACjD,OAAO,EAAE,oBAAoB,CAAC;gBAElB,OAAO,CAAC,EAAE,oBAAoB;IAIpC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAwB7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAcxC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAShD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BhD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Storage } from '@amplitude/analytics-types';
|
|
2
|
+
export declare class LocalStorage<T> implements Storage<T> {
|
|
3
|
+
isEnabled(): Promise<boolean>;
|
|
4
|
+
get(key: string): Promise<T | undefined>;
|
|
5
|
+
getRaw(key: string): Promise<string | undefined>;
|
|
6
|
+
set(key: string, value: T): Promise<void>;
|
|
7
|
+
remove(key: string): Promise<void>;
|
|
8
|
+
reset(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=local-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-storage.d.ts","sourceRoot":"","sources":["../../../src/storage/local-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAGrD,qBAAa,YAAY,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IAC1C,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAqB7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAcxC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIhD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQlC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAO7B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CookieStorage } from './cookie';
|
|
2
|
+
export declare class UTMCookie extends CookieStorage<Record<string, string | undefined>> {
|
|
3
|
+
get(key: string): Promise<Record<string, string | undefined> | undefined>;
|
|
4
|
+
set(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=utm-cookie.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utm-cookie.d.ts","sourceRoot":"","sources":["../../../src/storage/utm-cookie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,qBAAa,SAAU,SAAQ,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAoBzE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseTransport } from '@amplitude/analytics-core';
|
|
2
|
+
import { Payload, Response, Transport } from '@amplitude/analytics-types';
|
|
3
|
+
export declare class FetchTransport extends BaseTransport implements Transport {
|
|
4
|
+
send(serverUrl: string, payload: Payload): Promise<Response | null>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/transports/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE1E,qBAAa,cAAe,SAAQ,aAAc,YAAW,SAAS;IAC9D,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CAkB1E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseTransport } from '@amplitude/analytics-core';
|
|
2
|
+
import { Payload, Response, Transport } from '@amplitude/analytics-types';
|
|
3
|
+
export declare class SendBeaconTransport extends BaseTransport implements Transport {
|
|
4
|
+
send(serverUrl: string, payload: Payload): Promise<Response | null>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=send-beacon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send-beacon.d.ts","sourceRoot":"","sources":["../../../src/transports/send-beacon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE1E,qBAAa,mBAAoB,SAAQ,aAAc,YAAW,SAAS;IACnE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CA6B1E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseTransport } from '@amplitude/analytics-core';
|
|
2
|
+
import { Payload, Response, Transport } from '@amplitude/analytics-types';
|
|
3
|
+
export declare class XHRTransport extends BaseTransport implements Transport {
|
|
4
|
+
private state;
|
|
5
|
+
send(serverUrl: string, payload: Payload): Promise<Response | null>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=xhr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../src/transports/xhr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAE1E,qBAAa,YAAa,SAAQ,aAAc,YAAW,SAAS;IAClE,OAAO,CAAC,KAAK,CAEX;IAEI,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;CA2B1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookie-name.d.ts","sourceRoot":"","sources":["../../../src/utils/cookie-name.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,WAAY,MAAM,6CAE3C,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,MAAM,WAE9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../src/utils/language.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAAO,MAM9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/utils/platform.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,QAAO,OAExB,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,OAE3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/utils/query-params.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,QAAO,OAAO,MAAM,EAAE,MAAM,GAAG,SAAS,CAkBlE,CAAC"}
|