@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/CHANGELOG.md +18 -0
- package/dist/crossdeck.umd.min.js +2 -2
- package/dist/crossdeck.umd.min.js.map +1 -1
- package/dist/error-codes.json +1 -1
- package/dist/index.cjs +387 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +54 -338
- package/dist/index.d.ts +54 -338
- package/dist/index.mjs +387 -91
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs +422 -91
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +24 -1
- package/dist/react.d.ts +24 -1
- package/dist/react.mjs +422 -92
- package/dist/react.mjs.map +1 -1
- package/dist/types-BzoKor4z.d.mts +310 -0
- package/dist/types-BzoKor4z.d.ts +310 -0
- package/dist/vue.cjs +387 -91
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.mjs +387 -91
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
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 };
|