@cross-deck/web 1.0.1 → 1.2.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/react.d.mts CHANGED
@@ -1,3 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { C as CrossdeckOptions } from './types-BzoKor4z.mjs';
3
+
1
4
  /**
2
5
  * @cross-deck/web/react — React hooks for the Crossdeck SDK.
3
6
  *
@@ -27,6 +30,26 @@
27
30
  * ships). Android => Compose `State<Boolean>` wrapper (when Android
28
31
  * SDK ships).
29
32
  */
33
+
34
+ interface CrossdeckProviderProps extends Omit<CrossdeckOptions, "userId"> {
35
+ /**
36
+ * Optional. When defined, the provider calls Crossdeck.identify(userId)
37
+ * after init and on every change. When the prop flips back to undefined
38
+ * (logout), the provider calls Crossdeck.reset().
39
+ *
40
+ * Pass your auth library's stable user id directly:
41
+ * <CrossdeckProvider userId={session?.user?.id} … /> // NextAuth
42
+ * <CrossdeckProvider userId={user?.uid} … /> // Firebase
43
+ * <CrossdeckProvider userId={supabase.auth.user()?.id} … /> // Supabase
44
+ *
45
+ * Anonymous (pre-login) traffic stays anonymous until userId becomes
46
+ * defined — the SDK's anonymousId follows the same user record once
47
+ * identify lands, so attribution survives sign-up.
48
+ */
49
+ userId?: string | null | undefined;
50
+ children: ReactNode;
51
+ }
52
+ declare function CrossdeckProvider(props: CrossdeckProviderProps): ReactNode;
30
53
  /**
31
54
  * Subscribe a React component to a single entitlement key.
32
55
  *
@@ -65,4 +88,4 @@ declare function useEntitlement(key: string): boolean;
65
88
  */
66
89
  declare function useEntitlements(): readonly string[];
67
90
 
68
- export { useEntitlement, useEntitlements };
91
+ export { CrossdeckProvider, useEntitlement, useEntitlements };
package/dist/react.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { C as CrossdeckOptions } from './types-BzoKor4z.js';
3
+
1
4
  /**
2
5
  * @cross-deck/web/react — React hooks for the Crossdeck SDK.
3
6
  *
@@ -27,6 +30,26 @@
27
30
  * ships). Android => Compose `State<Boolean>` wrapper (when Android
28
31
  * SDK ships).
29
32
  */
33
+
34
+ interface CrossdeckProviderProps extends Omit<CrossdeckOptions, "userId"> {
35
+ /**
36
+ * Optional. When defined, the provider calls Crossdeck.identify(userId)
37
+ * after init and on every change. When the prop flips back to undefined
38
+ * (logout), the provider calls Crossdeck.reset().
39
+ *
40
+ * Pass your auth library's stable user id directly:
41
+ * <CrossdeckProvider userId={session?.user?.id} … /> // NextAuth
42
+ * <CrossdeckProvider userId={user?.uid} … /> // Firebase
43
+ * <CrossdeckProvider userId={supabase.auth.user()?.id} … /> // Supabase
44
+ *
45
+ * Anonymous (pre-login) traffic stays anonymous until userId becomes
46
+ * defined — the SDK's anonymousId follows the same user record once
47
+ * identify lands, so attribution survives sign-up.
48
+ */
49
+ userId?: string | null | undefined;
50
+ children: ReactNode;
51
+ }
52
+ declare function CrossdeckProvider(props: CrossdeckProviderProps): ReactNode;
30
53
  /**
31
54
  * Subscribe a React component to a single entitlement key.
32
55
  *
@@ -65,4 +88,4 @@ declare function useEntitlement(key: string): boolean;
65
88
  */
66
89
  declare function useEntitlements(): readonly string[];
67
90
 
68
- export { useEntitlement, useEntitlements };
91
+ export { CrossdeckProvider, useEntitlement, useEntitlements };