@thisbefine/analytics 0.1.0 → 0.2.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/LICENSE +1 -1
- package/README.md +6 -0
- package/dist/core/analytics.d.ts +57 -0
- package/dist/core/analytics.d.ts.map +1 -1
- package/dist/core/analytics.js +109 -0
- package/dist/core/analytics.js.map +1 -1
- package/dist/core/lifecycle.d.ts +198 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +29 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/types.d.ts +71 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/next.d.ts +2 -1
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +3 -1
- package/dist/next.js.map +1 -1
- package/dist/react/hooks.d.ts +141 -0
- package/dist/react/hooks.d.ts.map +1 -1
- package/dist/react/hooks.js +151 -0
- package/dist/react/hooks.js.map +1 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/package.json +105 -106
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,GACb,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,GACZ,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,GACb,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,UAAU,EACV,kBAAkB,EAClB,YAAY,GACZ,MAAM,eAAe,CAAC;AACvB,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,YAAY,EACX,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,YAAY,EACZ,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE1E,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
* @packageDocumentation
|
|
37
37
|
*/
|
|
38
38
|
export { createAnalytics, getAnalytics, initAnalytics, } from "./core/analytics";
|
|
39
|
+
export { LIFECYCLE_EVENTS } from "./core/lifecycle";
|
|
39
40
|
export { DEFAULT_CONFIG, LIBRARY_INFO, STORAGE_KEYS } from "./core/types";
|
|
40
41
|
export { createBugReportWidget } from "./widget/bug-report";
|
|
41
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,GACb,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EACN,eAAe,EACf,YAAY,EACZ,aAAa,GACb,MAAM,kBAAkB,CAAC;AAuB1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiBpD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/next.d.ts
CHANGED
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
*
|
|
40
40
|
* @packageDocumentation
|
|
41
41
|
*/
|
|
42
|
+
export type { AccountDeletedProps, FeatureActivatedProps, InviteAcceptedProps, InviteSentProps, LoginProps, LogoutProps, PlanDowngradedProps, PlanUpgradedProps, SignupProps, SubscriptionCancelledProps, SubscriptionRenewedProps, SubscriptionStartedProps, TrialEndedProps, TrialStartedProps, } from "./core/lifecycle";
|
|
42
43
|
export type { AccountTraits, Analytics as AnalyticsInstance, AnalyticsConfig, UserState, UserTraits, } from "./core/types";
|
|
43
44
|
export type { NextAnalyticsProps } from "./next/analytics";
|
|
44
45
|
export { Analytics } from "./next/analytics";
|
|
45
|
-
export { useAnalytics, useCaptureException, useGetUser, useGroup, useIdentify, useLog, usePage, useReset, useTrack, } from "./react/hooks";
|
|
46
|
+
export { useAccountDeleted, useAnalytics, useCaptureException, useFeatureActivated, useGetUser, useGroup, useIdentify, useInviteAccepted, useInviteSent, useLog, useLogin, useLogout, usePage, usePlanDowngraded, usePlanUpgraded, useReset, useSignup, useSubscriptionCancelled, useSubscriptionRenewed, useSubscriptionStarted, useTrack, useTrialEnded, useTrialStarted, } from "./react/hooks";
|
|
46
47
|
//# sourceMappingURL=next.d.ts.map
|
package/dist/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,aAAa,EACb,SAAS,IAAI,iBAAiB,EAC9B,eAAe,EACf,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAEN,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,eAAe,GACf,MAAM,eAAe,CAAC"}
|
package/dist/next.js
CHANGED
|
@@ -40,5 +40,7 @@
|
|
|
40
40
|
* @packageDocumentation
|
|
41
41
|
*/
|
|
42
42
|
export { Analytics } from "./next/analytics";
|
|
43
|
-
export {
|
|
43
|
+
export {
|
|
44
|
+
// Lifecycle hooks
|
|
45
|
+
useAccountDeleted, useAnalytics, useCaptureException, useFeatureActivated, useGetUser, useGroup, useIdentify, useInviteAccepted, useInviteSent, useLog, useLogin, useLogout, usePage, usePlanDowngraded, usePlanUpgraded, useReset, useSignup, useSubscriptionCancelled, useSubscriptionRenewed, useSubscriptionStarted, useTrack, useTrialEnded, useTrialStarted, } from "./react/hooks";
|
|
44
46
|
//# sourceMappingURL=next.js.map
|
package/dist/next.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AA4BH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO;AACN,kBAAkB;AAClB,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,eAAe,GACf,MAAM,eAAe,CAAC"}
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AccountDeletedProps, FeatureActivatedProps, InviteAcceptedProps, InviteSentProps, LoginProps, LogoutProps, PlanDowngradedProps, PlanUpgradedProps, SignupProps, SubscriptionCancelledProps, SubscriptionRenewedProps, SubscriptionStartedProps, TrialEndedProps, TrialStartedProps } from "../core/lifecycle";
|
|
1
2
|
import type { LogLevel } from "../core/logging";
|
|
2
3
|
import type { AccountTraits, Analytics, UserTraits } from "../core/types";
|
|
3
4
|
/**
|
|
@@ -138,4 +139,144 @@ export declare const useCaptureException: () => (error: Error, context?: Record<
|
|
|
138
139
|
* ```
|
|
139
140
|
*/
|
|
140
141
|
export declare const useLog: () => (message: string, level: LogLevel, metadata?: Record<string, unknown>) => void;
|
|
142
|
+
/**
|
|
143
|
+
* Hook to track user signups
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* const signup = useSignup();
|
|
148
|
+
* signup({ method: 'google', plan: 'free' });
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export declare const useSignup: () => (props?: SignupProps | undefined) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Hook to track user logins
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```tsx
|
|
157
|
+
* const login = useLogin();
|
|
158
|
+
* login({ method: 'passkey' });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare const useLogin: () => (props?: LoginProps | undefined) => void;
|
|
162
|
+
/**
|
|
163
|
+
* Hook to track user logouts
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```tsx
|
|
167
|
+
* const logout = useLogout();
|
|
168
|
+
* logout({ reason: 'manual' });
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export declare const useLogout: () => (props?: LogoutProps | undefined) => void;
|
|
172
|
+
/**
|
|
173
|
+
* Hook to track account deletion
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```tsx
|
|
177
|
+
* const accountDeleted = useAccountDeleted();
|
|
178
|
+
* accountDeleted({ reason: 'too_expensive', tenure: 90 });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export declare const useAccountDeleted: () => (props?: AccountDeletedProps | undefined) => void;
|
|
182
|
+
/**
|
|
183
|
+
* Hook to track subscription start
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```tsx
|
|
187
|
+
* const subscriptionStarted = useSubscriptionStarted();
|
|
188
|
+
* subscriptionStarted({ plan: 'pro', interval: 'yearly', mrr: 99 });
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export declare const useSubscriptionStarted: () => (props?: SubscriptionStartedProps | undefined) => void;
|
|
192
|
+
/**
|
|
193
|
+
* Hook to track subscription cancellation
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```tsx
|
|
197
|
+
* const subscriptionCancelled = useSubscriptionCancelled();
|
|
198
|
+
* subscriptionCancelled({ plan: 'pro', reason: 'too_expensive' });
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export declare const useSubscriptionCancelled: () => (props?: SubscriptionCancelledProps | undefined) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Hook to track subscription renewal
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```tsx
|
|
207
|
+
* const subscriptionRenewed = useSubscriptionRenewed();
|
|
208
|
+
* subscriptionRenewed({ plan: 'pro', renewalCount: 12 });
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
export declare const useSubscriptionRenewed: () => (props?: SubscriptionRenewedProps | undefined) => void;
|
|
212
|
+
/**
|
|
213
|
+
* Hook to track plan upgrade
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```tsx
|
|
217
|
+
* const planUpgraded = usePlanUpgraded();
|
|
218
|
+
* planUpgraded({ fromPlan: 'starter', toPlan: 'pro', mrrChange: 50 });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
export declare const usePlanUpgraded: () => (props?: PlanUpgradedProps | undefined) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Hook to track plan downgrade
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```tsx
|
|
227
|
+
* const planDowngraded = usePlanDowngraded();
|
|
228
|
+
* planDowngraded({ fromPlan: 'pro', toPlan: 'starter', reason: 'budget' });
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare const usePlanDowngraded: () => (props?: PlanDowngradedProps | undefined) => void;
|
|
232
|
+
/**
|
|
233
|
+
* Hook to track trial start
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```tsx
|
|
237
|
+
* const trialStarted = useTrialStarted();
|
|
238
|
+
* trialStarted({ plan: 'pro', trialDays: 14 });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
export declare const useTrialStarted: () => (props?: TrialStartedProps | undefined) => void;
|
|
242
|
+
/**
|
|
243
|
+
* Hook to track trial end
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* ```tsx
|
|
247
|
+
* const trialEnded = useTrialEnded();
|
|
248
|
+
* trialEnded({ plan: 'pro', converted: true });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
export declare const useTrialEnded: () => (props?: TrialEndedProps | undefined) => void;
|
|
252
|
+
/**
|
|
253
|
+
* Hook to track invite sent
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```tsx
|
|
257
|
+
* const inviteSent = useInviteSent();
|
|
258
|
+
* inviteSent({ inviteEmail: 'colleague@example.com', role: 'editor' });
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
export declare const useInviteSent: () => (props?: InviteSentProps | undefined) => void;
|
|
262
|
+
/**
|
|
263
|
+
* Hook to track invite accepted
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* ```tsx
|
|
267
|
+
* const inviteAccepted = useInviteAccepted();
|
|
268
|
+
* inviteAccepted({ invitedBy: 'user_123', role: 'editor' });
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
export declare const useInviteAccepted: () => (props?: InviteAcceptedProps | undefined) => void;
|
|
272
|
+
/**
|
|
273
|
+
* Hook to track feature activation
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```tsx
|
|
277
|
+
* const featureActivated = useFeatureActivated();
|
|
278
|
+
* featureActivated({ feature: 'dark_mode', isFirstTime: true });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
export declare const useFeatureActivated: () => (props?: FeatureActivatedProps | undefined) => void;
|
|
141
282
|
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiB1E;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,QAAO,SAE/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,QAAQ,GAAI,WAAW,MAAM,mBAE1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAKtC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,iBACK,MAAM,WAAW,UAAU,SAGvD,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,oBACW,MAAM,WAAW,aAAa,SAG7D,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,gBACQ,MAAM,eAAe,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAGvE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,QAAQ,kBAIpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAA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+183,155 @@ export const useLog = () => {
|
|
|
183
183
|
getAnalytics()?.log(message, level, metadata);
|
|
184
184
|
}, []);
|
|
185
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* Factory helper to create lifecycle hooks
|
|
188
|
+
*/
|
|
189
|
+
const createLifecycleHook = (method) => {
|
|
190
|
+
return () => useCallback((props) => {
|
|
191
|
+
const analytics = getAnalytics();
|
|
192
|
+
if (analytics && method in analytics) {
|
|
193
|
+
analytics[method]?.(props);
|
|
194
|
+
}
|
|
195
|
+
}, []);
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Hook to track user signups
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```tsx
|
|
202
|
+
* const signup = useSignup();
|
|
203
|
+
* signup({ method: 'google', plan: 'free' });
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export const useSignup = createLifecycleHook("signup");
|
|
207
|
+
/**
|
|
208
|
+
* Hook to track user logins
|
|
209
|
+
*
|
|
210
|
+
* @example
|
|
211
|
+
* ```tsx
|
|
212
|
+
* const login = useLogin();
|
|
213
|
+
* login({ method: 'passkey' });
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
export const useLogin = createLifecycleHook("login");
|
|
217
|
+
/**
|
|
218
|
+
* Hook to track user logouts
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```tsx
|
|
222
|
+
* const logout = useLogout();
|
|
223
|
+
* logout({ reason: 'manual' });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
export const useLogout = createLifecycleHook("logout");
|
|
227
|
+
/**
|
|
228
|
+
* Hook to track account deletion
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```tsx
|
|
232
|
+
* const accountDeleted = useAccountDeleted();
|
|
233
|
+
* accountDeleted({ reason: 'too_expensive', tenure: 90 });
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
export const useAccountDeleted = createLifecycleHook("accountDeleted");
|
|
237
|
+
/**
|
|
238
|
+
* Hook to track subscription start
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```tsx
|
|
242
|
+
* const subscriptionStarted = useSubscriptionStarted();
|
|
243
|
+
* subscriptionStarted({ plan: 'pro', interval: 'yearly', mrr: 99 });
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export const useSubscriptionStarted = createLifecycleHook("subscriptionStarted");
|
|
247
|
+
/**
|
|
248
|
+
* Hook to track subscription cancellation
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```tsx
|
|
252
|
+
* const subscriptionCancelled = useSubscriptionCancelled();
|
|
253
|
+
* subscriptionCancelled({ plan: 'pro', reason: 'too_expensive' });
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
export const useSubscriptionCancelled = createLifecycleHook("subscriptionCancelled");
|
|
257
|
+
/**
|
|
258
|
+
* Hook to track subscription renewal
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```tsx
|
|
262
|
+
* const subscriptionRenewed = useSubscriptionRenewed();
|
|
263
|
+
* subscriptionRenewed({ plan: 'pro', renewalCount: 12 });
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
export const useSubscriptionRenewed = createLifecycleHook("subscriptionRenewed");
|
|
267
|
+
/**
|
|
268
|
+
* Hook to track plan upgrade
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```tsx
|
|
272
|
+
* const planUpgraded = usePlanUpgraded();
|
|
273
|
+
* planUpgraded({ fromPlan: 'starter', toPlan: 'pro', mrrChange: 50 });
|
|
274
|
+
* ```
|
|
275
|
+
*/
|
|
276
|
+
export const usePlanUpgraded = createLifecycleHook("planUpgraded");
|
|
277
|
+
/**
|
|
278
|
+
* Hook to track plan downgrade
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```tsx
|
|
282
|
+
* const planDowngraded = usePlanDowngraded();
|
|
283
|
+
* planDowngraded({ fromPlan: 'pro', toPlan: 'starter', reason: 'budget' });
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
export const usePlanDowngraded = createLifecycleHook("planDowngraded");
|
|
287
|
+
/**
|
|
288
|
+
* Hook to track trial start
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```tsx
|
|
292
|
+
* const trialStarted = useTrialStarted();
|
|
293
|
+
* trialStarted({ plan: 'pro', trialDays: 14 });
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export const useTrialStarted = createLifecycleHook("trialStarted");
|
|
297
|
+
/**
|
|
298
|
+
* Hook to track trial end
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```tsx
|
|
302
|
+
* const trialEnded = useTrialEnded();
|
|
303
|
+
* trialEnded({ plan: 'pro', converted: true });
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
export const useTrialEnded = createLifecycleHook("trialEnded");
|
|
307
|
+
/**
|
|
308
|
+
* Hook to track invite sent
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```tsx
|
|
312
|
+
* const inviteSent = useInviteSent();
|
|
313
|
+
* inviteSent({ inviteEmail: 'colleague@example.com', role: 'editor' });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
export const useInviteSent = createLifecycleHook("inviteSent");
|
|
317
|
+
/**
|
|
318
|
+
* Hook to track invite accepted
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* ```tsx
|
|
322
|
+
* const inviteAccepted = useInviteAccepted();
|
|
323
|
+
* inviteAccepted({ invitedBy: 'user_123', role: 'editor' });
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
export const useInviteAccepted = createLifecycleHook("inviteAccepted");
|
|
327
|
+
/**
|
|
328
|
+
* Hook to track feature activation
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```tsx
|
|
332
|
+
* const featureActivated = useFeatureActivated();
|
|
333
|
+
* featureActivated({ feature: 'dark_mode', isFirstTime: true });
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
336
|
+
export const useFeatureActivated = createLifecycleHook("featureActivated");
|
|
186
337
|
//# sourceMappingURL=hooks.js.map
|
package/dist/react/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAoBjD;;GAEG;AACH,MAAM,mBAAmB,GAAG,GAAc,EAAE;IAC3C,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,IAAI,CAAC,SAAS,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACd,gFAAgF,CAChF,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAc,EAAE;IAC3C,OAAO,mBAAmB,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC7C,OAAO,WAAW,CACjB,CAAC,UAAoC,EAAE,EAAE;QACxC,YAAY,EAAE,EAAE,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC,EACD,CAAC,SAAS,CAA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CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAClC,mBAAmB,CAA2B,qBAAqB,CAAC,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACpC,mBAAmB,CAA6B,uBAAuB,CAAC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAClC,mBAAmB,CAA2B,qBAAqB,CAAC,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAC3B,mBAAmB,CAAoB,cAAc,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC7B,mBAAmB,CAAsB,gBAAgB,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAC3B,mBAAmB,CAAoB,cAAc,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAkB,YAAY,CAAC,CAAC;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAkB,YAAY,CAAC,CAAC;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC7B,mBAAmB,CAAsB,gBAAgB,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC/B,mBAAmB,CAAwB,kBAAkB,CAAC,CAAC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -33,10 +33,11 @@
|
|
|
33
33
|
*
|
|
34
34
|
* @packageDocumentation
|
|
35
35
|
*/
|
|
36
|
+
export type { AccountDeletedProps, FeatureActivatedProps, InviteAcceptedProps, InviteSentProps, LoginProps, LogoutProps, PlanDowngradedProps, PlanUpgradedProps, SignupProps, SubscriptionCancelledProps, SubscriptionRenewedProps, SubscriptionStartedProps, TrialEndedProps, TrialStartedProps, } from "./core/lifecycle";
|
|
36
37
|
export type { AccountTraits, Analytics as AnalyticsInstance, AnalyticsConfig, UserState, UserTraits, } from "./core/types";
|
|
37
38
|
export type { AnalyticsProps } from "./react/analytics";
|
|
38
39
|
export { Analytics } from "./react/analytics";
|
|
39
40
|
export type { BugReportFABProps } from "./react/bug-report-widget";
|
|
40
41
|
export { BugReportFAB } from "./react/bug-report-widget";
|
|
41
|
-
export { useAnalytics, useCaptureException, useGetUser, useGroup, useIdentify, useLog, usePage, useReset, useTrack, } from "./react/hooks";
|
|
42
|
+
export { useAccountDeleted, useAnalytics, useCaptureException, useFeatureActivated, useGetUser, useGroup, useIdentify, useInviteAccepted, useInviteSent, useLog, useLogin, useLogout, usePage, usePlanDowngraded, usePlanUpgraded, useReset, useSignup, useSubscriptionCancelled, useSubscriptionRenewed, useSubscriptionStarted, useTrack, useTrialEnded, useTrialStarted, } from "./react/hooks";
|
|
42
43
|
//# sourceMappingURL=react.d.ts.map
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,YAAY,EACX,aAAa,EACb,SAAS,IAAI,iBAAiB,EAC9B,eAAe,EACf,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,aAAa,EACb,SAAS,IAAI,iBAAiB,EAC9B,eAAe,EACf,SAAS,EACT,UAAU,GACV,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACN,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,eAAe,GACf,MAAM,eAAe,CAAC"}
|
package/dist/react.js
CHANGED
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
*/
|
|
36
36
|
export { Analytics } from "./react/analytics";
|
|
37
37
|
export { BugReportFAB } from "./react/bug-report-widget";
|
|
38
|
-
export { useAnalytics, useCaptureException, useGetUser, useGroup, useIdentify, useLog, usePage, useReset, useTrack, } from "./react/hooks";
|
|
38
|
+
export { useAccountDeleted, useAnalytics, useCaptureException, useFeatureActivated, useGetUser, useGroup, useIdentify, useInviteAccepted, useInviteSent, useLog, useLogin, useLogout, usePage, usePlanDowngraded, usePlanUpgraded, useReset, useSignup, useSubscriptionCancelled, useSubscriptionRenewed, useSubscriptionStarted, useTrack, useTrialEnded, useTrialStarted, } from "./react/hooks";
|
|
39
39
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AA2BH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EACN,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,QAAQ,EACR,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,eAAe,GACf,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,107 +1,106 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
2
|
+
"name": "@thisbefine/analytics",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Track events, catch errors, and pretend everything's fine. Lightweight analytics for indie SaaS.",
|
|
5
|
+
"author": "Thisbefine <hello@thisbefine.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://thisbefine.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/thisbefine/analytics.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/thisbefine/analytics/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./react": {
|
|
32
|
+
"types": "./dist/react.d.ts",
|
|
33
|
+
"default": "./dist/react.js"
|
|
34
|
+
},
|
|
35
|
+
"./next": {
|
|
36
|
+
"types": "./dist/next.d.ts",
|
|
37
|
+
"default": "./dist/next.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"next": ">=13",
|
|
46
|
+
"react": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"peerDependenciesMeta": {
|
|
49
|
+
"next": {
|
|
50
|
+
"optional": true
|
|
51
|
+
},
|
|
52
|
+
"react": {
|
|
53
|
+
"optional": true
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@biomejs/biome": "2.3.13",
|
|
58
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
59
|
+
"@testing-library/react": "^16.1.0",
|
|
60
|
+
"@types/node": "^25.1.0",
|
|
61
|
+
"@types/react": "^19.2.10",
|
|
62
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
63
|
+
"@vitest/ui": "^3.0.0",
|
|
64
|
+
"jsdom": "^27.4.0",
|
|
65
|
+
"next": "^16.1.6",
|
|
66
|
+
"react": "^19.2.4",
|
|
67
|
+
"react-dom": "^19.2.4",
|
|
68
|
+
"typescript": "^5.9.3",
|
|
69
|
+
"vitest": "^3.0.0"
|
|
70
|
+
},
|
|
71
|
+
"keywords": [
|
|
72
|
+
"analytics",
|
|
73
|
+
"tracking",
|
|
74
|
+
"events",
|
|
75
|
+
"pageviews",
|
|
76
|
+
"user-identification",
|
|
77
|
+
"session-tracking",
|
|
78
|
+
"error-tracking",
|
|
79
|
+
"logging",
|
|
80
|
+
"nextjs",
|
|
81
|
+
"react",
|
|
82
|
+
"typescript",
|
|
83
|
+
"privacy",
|
|
84
|
+
"gdpr",
|
|
85
|
+
"thisbefine",
|
|
86
|
+
"saas",
|
|
87
|
+
"product-analytics"
|
|
88
|
+
],
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"uuid": "^13.0.0"
|
|
91
|
+
},
|
|
92
|
+
"scripts": {
|
|
93
|
+
"prebuild": "node scripts/generate-version.js",
|
|
94
|
+
"build": "tsc --project tsconfig.build.json",
|
|
95
|
+
"dev": "tsc --project tsconfig.build.json --watch",
|
|
96
|
+
"typecheck": "tsc --noEmit",
|
|
97
|
+
"format": "biome check . --write",
|
|
98
|
+
"lint": "biome check .",
|
|
99
|
+
"clean": "rm -rf dist",
|
|
100
|
+
"test": "vitest",
|
|
101
|
+
"test:run": "vitest run",
|
|
102
|
+
"test:watch": "vitest --watch",
|
|
103
|
+
"test:coverage": "vitest run --coverage",
|
|
104
|
+
"test:ui": "vitest --ui"
|
|
105
|
+
}
|
|
106
|
+
}
|