@usesequential/browser 0.0.0-stage → 1.0.1
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +97 -2
- package/dist/index.cjs +1950 -0
- package/dist/index.d.cts +49 -0
- package/dist/index.d.mts +49 -0
- package/dist/index.mjs +1948 -0
- package/package.json +48 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Types for @usesequential/browser. The methods are those of the script tag's `window.sequential`
|
|
2
|
+
// (https://www.usesequential.com/docs/sequential).
|
|
3
|
+
|
|
4
|
+
export interface InitOptions {
|
|
5
|
+
/** The project's `sequential` ingest key, `sq_sequential_…`, from Setup. Required. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** The ingest host, such as `https://api.usesequential.com`. Required. */
|
|
8
|
+
api: string;
|
|
9
|
+
/** Your app's build, sent as `$release` on every event: 1 to 64 printable ASCII characters. */
|
|
10
|
+
release?: string;
|
|
11
|
+
/** Start opted out, as the tag's `data-opt-out`: nothing is sent and nothing is stored until `optIn()`. */
|
|
12
|
+
optOut?: boolean;
|
|
13
|
+
/** `false` turns off automatic page views, clicks and form submits, as `data-autocapture="false"`. */
|
|
14
|
+
autocapture?: boolean;
|
|
15
|
+
/** `false` turns off the check that keeps the signed-in person's name and email out of click text, as
|
|
16
|
+
* `data-identity-text="off"`. */
|
|
17
|
+
identityText?: boolean;
|
|
18
|
+
/** `Domain=` for the context cookie `__sq_ctx`, as `data-context-cookie-domain`. */
|
|
19
|
+
contextCookieDomain?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface Sequential {
|
|
23
|
+
/** Sends a custom event. Names that start with `$` are reserved and throw. */
|
|
24
|
+
capture(event: string, props?: Record<string, unknown>): void;
|
|
25
|
+
/** Names the person. Changed properties send a new `$identify` event. */
|
|
26
|
+
identify(distinctId: string, props?: Record<string, unknown>): void;
|
|
27
|
+
/** B2B: the account (company, workspace) this person acts for. Every later event carries its id. */
|
|
28
|
+
account(id: string | number, traits?: Record<string, unknown>): void;
|
|
29
|
+
/** Properties added to every later event of this page load. */
|
|
30
|
+
register(props: Record<string, unknown>): void;
|
|
31
|
+
unregister(propKey: string): void;
|
|
32
|
+
/** A new anonymous visitor and session, for example at sign-out. */
|
|
33
|
+
reset(): void;
|
|
34
|
+
/** Stops analytics and session replay, deletes the stored ids, and keeps the `__sq_opt` choice. */
|
|
35
|
+
optOut(): void;
|
|
36
|
+
/** Deletes the `__sq_opt` choice and starts recording. */
|
|
37
|
+
optIn(): void;
|
|
38
|
+
captureException(error: unknown, props?: Record<string, unknown>): void;
|
|
39
|
+
/** Sends the queued events now. */
|
|
40
|
+
flush(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Starts the SDK once and returns it. Without a window (server rendering), or without `key` and `api`, it returns an
|
|
44
|
+
* object whose methods do nothing. A second call, or a page where the script tag already loaded the SDK, returns the
|
|
45
|
+
* running instance. */
|
|
46
|
+
export declare function init(options: InitOptions): Sequential;
|
|
47
|
+
|
|
48
|
+
/** This package's version. */
|
|
49
|
+
export declare const VERSION: string;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Types for @usesequential/browser. The methods are those of the script tag's `window.sequential`
|
|
2
|
+
// (https://www.usesequential.com/docs/sequential).
|
|
3
|
+
|
|
4
|
+
export interface InitOptions {
|
|
5
|
+
/** The project's `sequential` ingest key, `sq_sequential_…`, from Setup. Required. */
|
|
6
|
+
key: string;
|
|
7
|
+
/** The ingest host, such as `https://api.usesequential.com`. Required. */
|
|
8
|
+
api: string;
|
|
9
|
+
/** Your app's build, sent as `$release` on every event: 1 to 64 printable ASCII characters. */
|
|
10
|
+
release?: string;
|
|
11
|
+
/** Start opted out, as the tag's `data-opt-out`: nothing is sent and nothing is stored until `optIn()`. */
|
|
12
|
+
optOut?: boolean;
|
|
13
|
+
/** `false` turns off automatic page views, clicks and form submits, as `data-autocapture="false"`. */
|
|
14
|
+
autocapture?: boolean;
|
|
15
|
+
/** `false` turns off the check that keeps the signed-in person's name and email out of click text, as
|
|
16
|
+
* `data-identity-text="off"`. */
|
|
17
|
+
identityText?: boolean;
|
|
18
|
+
/** `Domain=` for the context cookie `__sq_ctx`, as `data-context-cookie-domain`. */
|
|
19
|
+
contextCookieDomain?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface Sequential {
|
|
23
|
+
/** Sends a custom event. Names that start with `$` are reserved and throw. */
|
|
24
|
+
capture(event: string, props?: Record<string, unknown>): void;
|
|
25
|
+
/** Names the person. Changed properties send a new `$identify` event. */
|
|
26
|
+
identify(distinctId: string, props?: Record<string, unknown>): void;
|
|
27
|
+
/** B2B: the account (company, workspace) this person acts for. Every later event carries its id. */
|
|
28
|
+
account(id: string | number, traits?: Record<string, unknown>): void;
|
|
29
|
+
/** Properties added to every later event of this page load. */
|
|
30
|
+
register(props: Record<string, unknown>): void;
|
|
31
|
+
unregister(propKey: string): void;
|
|
32
|
+
/** A new anonymous visitor and session, for example at sign-out. */
|
|
33
|
+
reset(): void;
|
|
34
|
+
/** Stops analytics and session replay, deletes the stored ids, and keeps the `__sq_opt` choice. */
|
|
35
|
+
optOut(): void;
|
|
36
|
+
/** Deletes the `__sq_opt` choice and starts recording. */
|
|
37
|
+
optIn(): void;
|
|
38
|
+
captureException(error: unknown, props?: Record<string, unknown>): void;
|
|
39
|
+
/** Sends the queued events now. */
|
|
40
|
+
flush(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Starts the SDK once and returns it. Without a window (server rendering), or without `key` and `api`, it returns an
|
|
44
|
+
* object whose methods do nothing. A second call, or a page where the script tag already loaded the SDK, returns the
|
|
45
|
+
* running instance. */
|
|
46
|
+
export declare function init(options: InitOptions): Sequential;
|
|
47
|
+
|
|
48
|
+
/** This package's version. */
|
|
49
|
+
export declare const VERSION: string;
|