@faststats/react 0.2.9 → 0.2.11

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.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConsentMode, FeatureFlagEvaluation, WebAnalyticsOptions, reportError } from "@faststats/web";
1
+ import { ConsentMode, FeatureFlagEvaluation, IdentifyOptions, WebAnalyticsOptions, reportError } from "@faststats/web";
2
2
 
3
3
  //#region src/analytics.d.ts
4
4
  type AnalyticsProps = WebAnalyticsOptions;
@@ -7,12 +7,7 @@ declare function Analytics(props: AnalyticsProps): null;
7
7
  //#region src/hooks.d.ts
8
8
  declare function useTrack(): (name: string, extra?: Record<string, unknown>) => void;
9
9
  declare function useEvent(name: string, extra?: Record<string, unknown>): () => void;
10
- declare function useIdentify(): (externalId: string, email: string, options?: {
11
- name?: string;
12
- phone?: string;
13
- avatarUrl?: string;
14
- traits?: Record<string, unknown>;
15
- }) => void;
10
+ declare function useIdentify(): (externalId: string, email: string, options?: IdentifyOptions) => Promise<boolean>;
16
11
  declare function useLogout(): (resetAnonymousIdentity?: boolean) => void;
17
12
  declare function useConsentMode(): (mode: ConsentMode) => void;
18
13
  declare function useOptIn(): () => void;
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ function setInstance(wa) {
20
20
  //#endregion
21
21
  //#region src/sdk.ts
22
22
  const SDK_NAME = "@faststats/react";
23
- const SDK_VERSION = "0.2.9";
23
+ const SDK_VERSION = "0.2.11";
24
24
  //#endregion
25
25
  //#region src/analytics.tsx
26
26
  function Analytics(props) {
@@ -76,7 +76,7 @@ function useEvent(name, extra) {
76
76
  }
77
77
  function useIdentify() {
78
78
  return (externalId, email, options) => {
79
- getActiveInstance()?.identify(externalId, email, options);
79
+ return getActiveInstance()?.identify(externalId, email, options) ?? Promise.resolve(false);
80
80
  };
81
81
  }
82
82
  function useLogout() {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/faststats-dev/faststats-javascript.git"
6
6
  },
7
- "version": "0.2.9",
7
+ "version": "0.2.11",
8
8
  "type": "module",
9
9
  "main": "./dist/index.js",
10
10
  "module": "./dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "react": ">=18"
32
32
  },
33
33
  "dependencies": {
34
- "@faststats/web": "^0.2.9"
34
+ "@faststats/web": "^0.2.11"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/react": "^19.0.0",