@jitsu/js 0.0.0-alpha.108
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/.pnpm-debug.log +23 -0
- package/.turbo/turbo-build.log +15 -0
- package/.turbo/turbo-clean.log +5 -0
- package/__tests__/node/nodejs.test.ts +84 -0
- package/__tests__/playwright/cases/basic.html +27 -0
- package/__tests__/playwright/cases/segment-reference.html +64 -0
- package/__tests__/playwright/integration.test.ts +262 -0
- package/__tests__/simple-syrup.ts +130 -0
- package/dist/jitsu.cjs.js +1419 -0
- package/dist/jitsu.d.ts +48 -0
- package/dist/jitsu.es.js +1417 -0
- package/dist/web/p.js.txt +1475 -0
- package/jest.config.js +13 -0
- package/package.json +50 -0
- package/playwrite.config.ts +91 -0
- package/rollup.config.js +25 -0
- package/src/analytics-plugin.ts +396 -0
- package/src/browser.ts +78 -0
- package/src/index.ts +46 -0
- package/src/jitsu.d.ts +48 -0
- package/tsconfig.json +22 -0
- package/tsconfig.test.json +15 -0
package/dist/jitsu.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AnalyticsInterface } from "@jitsu/types/analytics";
|
|
2
|
+
import type { AnalyticsPlugin } from "analytics";
|
|
3
|
+
|
|
4
|
+
export type JitsuOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* API Key. Optional. If not set, Jitsu will send event to the server without auth, and server
|
|
7
|
+
* will link the call to configured source by domain name
|
|
8
|
+
*/
|
|
9
|
+
writeKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* API Host. Default value: same host as script origin
|
|
12
|
+
*/
|
|
13
|
+
host?: string;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
cookieDomain?: string;
|
|
16
|
+
fetch?: typeof fetch;
|
|
17
|
+
runtime?: RuntimeFacade;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type PersistentStorage = {
|
|
21
|
+
getItem: (key: string, options?: any) => any;
|
|
22
|
+
setItem: (key: string, value: any, options?: any) => void;
|
|
23
|
+
removeItem: (key: string, options?: any) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type RuntimeFacade = {
|
|
27
|
+
store(): PersistentStorage;
|
|
28
|
+
userAgent(): string | undefined;
|
|
29
|
+
language(): string | undefined;
|
|
30
|
+
pageUrl(): string | undefined;
|
|
31
|
+
documentEncoding(): string | undefined;
|
|
32
|
+
timezoneOffset(): number | undefined;
|
|
33
|
+
screen():
|
|
34
|
+
| {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
innerWidth: number;
|
|
38
|
+
innerHeight: number;
|
|
39
|
+
density: number;
|
|
40
|
+
}
|
|
41
|
+
| undefined;
|
|
42
|
+
referrer(): string | undefined;
|
|
43
|
+
pageTitle(): string | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export declare function jitsuAnalytics(opts: JitsuOptions): AnalyticsInterface;
|
|
47
|
+
|
|
48
|
+
declare const jitsuAnalyticsPlugin: AnalyticsPlugin;
|