@jitsu/js 1.9.18-canary.1269.20250403142744 → 1.9.18-canary.1288.20250415191203
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/.turbo/turbo-build.log +67 -0
- package/.turbo/turbo-clean.log +5 -0
- package/.turbo/turbo-test.log +2884 -0
- package/__tests__/node/method-queue.test.ts +66 -0
- package/__tests__/node/nodejs.test.ts +306 -0
- package/__tests__/playwright/cases/anonymous-id-bug.html +26 -0
- package/__tests__/playwright/cases/basic.html +32 -0
- package/__tests__/playwright/cases/callbacks.html +21 -0
- package/__tests__/playwright/cases/cookie-names.html +22 -0
- package/__tests__/playwright/cases/disable-user-ids.html +23 -0
- package/__tests__/playwright/cases/dont-send.html +22 -0
- package/__tests__/playwright/cases/ip-policy.html +22 -0
- package/__tests__/playwright/cases/reset.html +32 -0
- package/__tests__/playwright/cases/segment-reference.html +64 -0
- package/__tests__/playwright/cases/url-bug.html +20 -0
- package/__tests__/playwright/integration.test.ts +640 -0
- package/__tests__/simple-syrup.ts +136 -0
- package/dist/jitsu.cjs.js +4 -8
- package/dist/jitsu.es.js +4 -8
- package/dist/web/p.js.txt +4 -8
- package/jest.config.js +13 -0
- package/package/README.md +9 -0
- package/package/dist/analytics-plugin.d.ts +28 -0
- package/package/dist/browser.d.ts +10 -0
- package/package/dist/index.d.ts +28 -0
- package/package/dist/jitsu.cjs.js +2100 -0
- package/package/dist/jitsu.d.ts +78 -0
- package/package/dist/jitsu.es.js +2090 -0
- package/package/dist/method-queue.d.ts +19 -0
- package/package/dist/script-loader.d.ts +8 -0
- package/package/dist/tlds.d.ts +3 -0
- package/package/dist/version.d.ts +3 -0
- package/package/dist/web/p.js.txt +2219 -0
- package/package/package.json +56 -0
- package/package.json +3 -9
- package/playwrite.config.ts +91 -0
- package/rollup.config.js +32 -0
- package/src/analytics-plugin.ts +989 -0
- package/src/browser.ts +163 -0
- package/src/destination-plugins/ga4.ts +138 -0
- package/src/destination-plugins/gtm.ts +142 -0
- package/src/destination-plugins/index.ts +61 -0
- package/src/destination-plugins/logrocket.ts +85 -0
- package/src/destination-plugins/tag.ts +85 -0
- package/src/index.ts +255 -0
- package/src/method-queue.ts +70 -0
- package/src/script-loader.ts +76 -0
- package/src/tlds.ts +27 -0
- package/src/version.ts +6 -0
- package/tsconfig.json +23 -0
- package/tsconfig.test.json +15 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
2
|
+
type JitsuOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* API Key. Optional. If not set, Jitsu will send event to the server without auth, and server
|
|
5
|
+
* will link the call to configured source by domain name
|
|
6
|
+
*/
|
|
7
|
+
writeKey?: string;
|
|
8
|
+
/**
|
|
9
|
+
* API Host. Default value: same host as script origin
|
|
10
|
+
*/
|
|
11
|
+
host?: string;
|
|
12
|
+
/**
|
|
13
|
+
* To enable debug logging
|
|
14
|
+
*/
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Explicitly specify cookie domain. If not set, cookie domain will be set to top level
|
|
18
|
+
* of the current domain. Example: if JS lives on "app.example.com", cookie domain will be
|
|
19
|
+
* set to ".example.com". If it lives on "example.com", cookie domain will be set to ".example.com" too
|
|
20
|
+
*/
|
|
21
|
+
cookieDomain?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Provide fetch implementation. It is required if you want to use Jitsu in NodeJS
|
|
24
|
+
*/
|
|
25
|
+
fetch?: typeof fetch;
|
|
26
|
+
/**
|
|
27
|
+
* Which runtime to use. Runtime is used for obtaining context of the event: cookes,
|
|
28
|
+
* url, etc. At the moment, Jitsu supports browser runtime and NodeJS runtime, but you
|
|
29
|
+
* can provide your own implementation.
|
|
30
|
+
*
|
|
31
|
+
* If it's not set, the runtime will be detected automatically by presense of `window` object
|
|
32
|
+
*/
|
|
33
|
+
runtime?: RuntimeFacade;
|
|
34
|
+
/**
|
|
35
|
+
* If set to true, jitsu will output events in console. In this case you don't need to set
|
|
36
|
+
* writeKey / host. It's useful for debugging development environment
|
|
37
|
+
*/
|
|
38
|
+
echoEvents?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* If true, events will go to s2s endpoints like ${host}/api/s/s2s/{type}. Otherwise they'll go to ${host}/api/s/{type}.
|
|
41
|
+
*
|
|
42
|
+
* If not set at all, it will be detected automatically by presence of `window` object
|
|
43
|
+
*/
|
|
44
|
+
s2s?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Timeout for fetch requests. Default value: 5000
|
|
47
|
+
*/
|
|
48
|
+
fetchTimeoutMs?: number;
|
|
49
|
+
};
|
|
50
|
+
type PersistentStorage = {
|
|
51
|
+
getItem: (key: string, options?: any) => any;
|
|
52
|
+
setItem: (key: string, value: any, options?: any) => void;
|
|
53
|
+
removeItem: (key: string, options?: any) => void;
|
|
54
|
+
reset: () => void;
|
|
55
|
+
};
|
|
56
|
+
type RuntimeFacade = {
|
|
57
|
+
store(): PersistentStorage;
|
|
58
|
+
userAgent(): string | undefined;
|
|
59
|
+
language(): string | undefined;
|
|
60
|
+
pageUrl(): string | undefined;
|
|
61
|
+
documentEncoding(): string | undefined;
|
|
62
|
+
getCookie(name: string): string | undefined;
|
|
63
|
+
getCookies(): Record<string, string>;
|
|
64
|
+
timezoneOffset(): number | undefined;
|
|
65
|
+
screen():
|
|
66
|
+
| {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
innerWidth: number;
|
|
70
|
+
innerHeight: number;
|
|
71
|
+
density: number;
|
|
72
|
+
}
|
|
73
|
+
| undefined;
|
|
74
|
+
referrer(): string | undefined;
|
|
75
|
+
pageTitle(): string | undefined;
|
|
76
|
+
};
|
|
77
|
+
export declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
|
|
78
|
+
export { AnalyticsInterface, JitsuOptions, PersistentStorage, RuntimeFacade };
|