@outlit/browser 0.4.0 → 1.0.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/dist/index.d.mts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +56 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -50
- package/dist/index.mjs.map +1 -1
- package/dist/outlit.global.js +1 -1
- package/dist/outlit.global.js.map +1 -1
- package/dist/react/index.d.mts +18 -21
- package/dist/react/index.d.ts +18 -21
- package/dist/react/index.js +91 -41
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +92 -41
- package/dist/react/index.mjs.map +1 -1
- package/dist/{tracker-DK-2gYCi.d.mts → tracker-BY_JTlOP.d.mts} +23 -40
- package/dist/{tracker-DK-2gYCi.d.ts → tracker-BY_JTlOP.d.ts} +23 -40
- package/package.json +9 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TrackerConfig, BrowserTrackOptions, BrowserIdentifyOptions } from '@outlit/core';
|
|
1
|
+
import { TrackerConfig, BrowserTrackOptions, BrowserIdentifyOptions, CustomerIdentifier } from '@outlit/core';
|
|
2
2
|
|
|
3
3
|
interface OutlitOptions extends TrackerConfig {
|
|
4
4
|
/**
|
|
@@ -50,6 +50,9 @@ interface UserIdentity {
|
|
|
50
50
|
userId?: string;
|
|
51
51
|
traits?: Record<string, string | number | boolean | null>;
|
|
52
52
|
}
|
|
53
|
+
type BillingOptions = CustomerIdentifier & {
|
|
54
|
+
properties?: Record<string, string | number | boolean | null>;
|
|
55
|
+
};
|
|
53
56
|
declare class Outlit {
|
|
54
57
|
private publicKey;
|
|
55
58
|
private apiHost;
|
|
@@ -88,7 +91,7 @@ declare class Outlit {
|
|
|
88
91
|
* Links the anonymous visitor to a known user.
|
|
89
92
|
*
|
|
90
93
|
* When email or userId is provided, also sets the current user identity
|
|
91
|
-
* for stage events (activate, engaged,
|
|
94
|
+
* for stage events (activate, engaged, inactive).
|
|
92
95
|
*/
|
|
93
96
|
identify(options: BrowserIdentifyOptions): void;
|
|
94
97
|
/**
|
|
@@ -114,33 +117,27 @@ declare class Outlit {
|
|
|
114
117
|
*/
|
|
115
118
|
private applyUser;
|
|
116
119
|
/**
|
|
117
|
-
*
|
|
118
|
-
* This is typically called after a user completes onboarding or a key activation milestone.
|
|
119
|
-
* Requires the user to be identified (via setUser or identify with userId).
|
|
120
|
+
* User namespace methods for contact journey stages.
|
|
120
121
|
*/
|
|
121
|
-
|
|
122
|
+
readonly user: {
|
|
123
|
+
identify: (options: BrowserIdentifyOptions) => void;
|
|
124
|
+
activate: (properties?: Record<string, string | number | boolean | null>) => void;
|
|
125
|
+
engaged: (properties?: Record<string, string | number | boolean | null>) => void;
|
|
126
|
+
inactive: (properties?: Record<string, string | number | boolean | null>) => void;
|
|
127
|
+
};
|
|
122
128
|
/**
|
|
123
|
-
*
|
|
124
|
-
* This is typically called when a user reaches a usage milestone.
|
|
125
|
-
* Can also be computed automatically by the engagement cron.
|
|
129
|
+
* Customer namespace methods for billing status.
|
|
126
130
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
*/
|
|
133
|
-
paid(properties?: Record<string, string | number | boolean | null>): void;
|
|
134
|
-
/**
|
|
135
|
-
* Mark the current user as churned.
|
|
136
|
-
* This is typically called when a subscription is cancelled.
|
|
137
|
-
* Can also be triggered by Stripe integration.
|
|
138
|
-
*/
|
|
139
|
-
churned(properties?: Record<string, string | number | boolean | null>): void;
|
|
131
|
+
readonly customer: {
|
|
132
|
+
trialing: (options: BillingOptions) => void;
|
|
133
|
+
paid: (options: BillingOptions) => void;
|
|
134
|
+
churned: (options: BillingOptions) => void;
|
|
135
|
+
};
|
|
140
136
|
/**
|
|
141
137
|
* Internal method to send a stage event.
|
|
142
138
|
*/
|
|
143
139
|
private sendStageEvent;
|
|
140
|
+
private sendBillingEvent;
|
|
144
141
|
/**
|
|
145
142
|
* Get the current visitor ID.
|
|
146
143
|
* Returns null if tracking is not enabled.
|
|
@@ -204,24 +201,10 @@ declare function setUser(identity: UserIdentity): void;
|
|
|
204
201
|
*/
|
|
205
202
|
declare function clearUser(): void;
|
|
206
203
|
/**
|
|
207
|
-
*
|
|
208
|
-
* Convenience method that uses the singleton instance.
|
|
209
|
-
*/
|
|
210
|
-
declare function activate(properties?: Record<string, string | number | boolean | null>): void;
|
|
211
|
-
/**
|
|
212
|
-
* Mark the current user as engaged.
|
|
213
|
-
* Convenience method that uses the singleton instance.
|
|
214
|
-
*/
|
|
215
|
-
declare function engaged(properties?: Record<string, string | number | boolean | null>): void;
|
|
216
|
-
/**
|
|
217
|
-
* Mark the current user as paid.
|
|
218
|
-
* Convenience method that uses the singleton instance.
|
|
219
|
-
*/
|
|
220
|
-
declare function paid(properties?: Record<string, string | number | boolean | null>): void;
|
|
221
|
-
/**
|
|
222
|
-
* Mark the current user as churned.
|
|
204
|
+
* Access user and customer namespaces.
|
|
223
205
|
* Convenience method that uses the singleton instance.
|
|
224
206
|
*/
|
|
225
|
-
declare function
|
|
207
|
+
declare function user(): Outlit["user"];
|
|
208
|
+
declare function customer(): Outlit["customer"];
|
|
226
209
|
|
|
227
|
-
export { Outlit as O, type UserIdentity as U, identify as a, isTrackingEnabled as b, clearUser as c,
|
|
210
|
+
export { type BillingOptions as B, Outlit as O, type UserIdentity as U, identify as a, isTrackingEnabled as b, clearUser as c, customer as d, enableTracking as e, type OutlitOptions as f, getInstance as g, init as i, setUser as s, track as t, user as u };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outlit/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Outlit browser tracking SDK with React bindings",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Outlit AI",
|
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
"main": "./dist/index.js",
|
|
28
28
|
"module": "./dist/index.mjs",
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
|
+
"typesVersions": {
|
|
31
|
+
"*": {
|
|
32
|
+
"react": [
|
|
33
|
+
"./dist/react/index.d.ts"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
30
37
|
"exports": {
|
|
31
38
|
".": {
|
|
32
39
|
"types": "./dist/index.d.ts",
|
|
@@ -45,7 +52,7 @@
|
|
|
45
52
|
"dist"
|
|
46
53
|
],
|
|
47
54
|
"dependencies": {
|
|
48
|
-
"@outlit/core": "0.
|
|
55
|
+
"@outlit/core": "1.0.0"
|
|
49
56
|
},
|
|
50
57
|
"devDependencies": {
|
|
51
58
|
"@playwright/test": "^1.48.0",
|