@rovenue/web-sdk 0.0.0-stage → 0.16.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.
@@ -0,0 +1,67 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Rovenue } from './index.cjs';
4
+
5
+ declare function RovenueProvider({ client, children, }: {
6
+ client: Rovenue;
7
+ children: ReactNode;
8
+ }): react.JSX.Element;
9
+ declare function useRovenue(): Rovenue;
10
+
11
+ interface EntitlementsState {
12
+ /** null means "not known yet", never "this person has nothing". */
13
+ entitlements: Record<string, unknown> | null;
14
+ isLoading: boolean;
15
+ error: Error | null;
16
+ refresh: () => Promise<void>;
17
+ }
18
+ /**
19
+ * Entitlements, served from cache first.
20
+ *
21
+ * The initial value is the SDK's last-known cache rather than null, because
22
+ * the alternative is a first paint that shows the paywall to someone who has
23
+ * already paid to remove it. The network result replaces it when it arrives.
24
+ *
25
+ * `null` and `{}` are deliberately different: `{}` is a real answer meaning
26
+ * the subscriber has no entitlements, `null` means we have not found out.
27
+ * Collapsing them makes an outage indistinguishable from an unsubscribed
28
+ * user, and that difference decides whether an app locks someone out.
29
+ */
30
+ declare function useEntitlements(): EntitlementsState;
31
+ interface PlacementState {
32
+ placement: unknown;
33
+ isLoading: boolean;
34
+ error: Error | null;
35
+ }
36
+ /**
37
+ * A placement's served content (a funnel envelope, or nothing).
38
+ *
39
+ * An unknown placement returns an empty envelope rather than a 404, so this
40
+ * resolves with nothing to show instead of erroring — the caller renders
41
+ * nothing, which is the behaviour a placement that has not been configured
42
+ * yet should have.
43
+ */
44
+ declare function usePlacement(identifier: string): PlacementState;
45
+ interface CheckoutState {
46
+ /** Starts a checkout and redirects the browser to Stripe. */
47
+ start: (input: {
48
+ offeringIdentifier: string;
49
+ packageIdentifier: string;
50
+ successUrl: string;
51
+ cancelUrl: string;
52
+ idempotencyKey?: string;
53
+ }) => Promise<void>;
54
+ isStarting: boolean;
55
+ error: Error | null;
56
+ }
57
+ /**
58
+ * Starts a Stripe Checkout and sends the browser to it.
59
+ *
60
+ * `isStarting` exists so a caller can disable the button. A second click
61
+ * before the first session comes back would otherwise create a second
62
+ * session — which Stripe's idempotency only prevents if the caller passes
63
+ * the same key, and a caller that has not thought about it will not.
64
+ */
65
+ declare function useCheckout(): CheckoutState;
66
+
67
+ export { type CheckoutState, type EntitlementsState, type PlacementState, RovenueProvider, useCheckout, useEntitlements, usePlacement, useRovenue };
@@ -0,0 +1,67 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Rovenue } from './index.js';
4
+
5
+ declare function RovenueProvider({ client, children, }: {
6
+ client: Rovenue;
7
+ children: ReactNode;
8
+ }): react.JSX.Element;
9
+ declare function useRovenue(): Rovenue;
10
+
11
+ interface EntitlementsState {
12
+ /** null means "not known yet", never "this person has nothing". */
13
+ entitlements: Record<string, unknown> | null;
14
+ isLoading: boolean;
15
+ error: Error | null;
16
+ refresh: () => Promise<void>;
17
+ }
18
+ /**
19
+ * Entitlements, served from cache first.
20
+ *
21
+ * The initial value is the SDK's last-known cache rather than null, because
22
+ * the alternative is a first paint that shows the paywall to someone who has
23
+ * already paid to remove it. The network result replaces it when it arrives.
24
+ *
25
+ * `null` and `{}` are deliberately different: `{}` is a real answer meaning
26
+ * the subscriber has no entitlements, `null` means we have not found out.
27
+ * Collapsing them makes an outage indistinguishable from an unsubscribed
28
+ * user, and that difference decides whether an app locks someone out.
29
+ */
30
+ declare function useEntitlements(): EntitlementsState;
31
+ interface PlacementState {
32
+ placement: unknown;
33
+ isLoading: boolean;
34
+ error: Error | null;
35
+ }
36
+ /**
37
+ * A placement's served content (a funnel envelope, or nothing).
38
+ *
39
+ * An unknown placement returns an empty envelope rather than a 404, so this
40
+ * resolves with nothing to show instead of erroring — the caller renders
41
+ * nothing, which is the behaviour a placement that has not been configured
42
+ * yet should have.
43
+ */
44
+ declare function usePlacement(identifier: string): PlacementState;
45
+ interface CheckoutState {
46
+ /** Starts a checkout and redirects the browser to Stripe. */
47
+ start: (input: {
48
+ offeringIdentifier: string;
49
+ packageIdentifier: string;
50
+ successUrl: string;
51
+ cancelUrl: string;
52
+ idempotencyKey?: string;
53
+ }) => Promise<void>;
54
+ isStarting: boolean;
55
+ error: Error | null;
56
+ }
57
+ /**
58
+ * Starts a Stripe Checkout and sends the browser to it.
59
+ *
60
+ * `isStarting` exists so a caller can disable the button. A second click
61
+ * before the first session comes back would otherwise create a second
62
+ * session — which Stripe's idempotency only prevents if the caller passes
63
+ * the same key, and a caller that has not thought about it will not.
64
+ */
65
+ declare function useCheckout(): CheckoutState;
66
+
67
+ export { type CheckoutState, type EntitlementsState, type PlacementState, RovenueProvider, useCheckout, useEntitlements, usePlacement, useRovenue };
package/dist/react.js ADDED
@@ -0,0 +1,102 @@
1
+ import './chunk-V6TY7KAL.js';
2
+ import { createContext, useEffect, useContext, useState, useRef, useCallback } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var RovenueContext = createContext(null);
6
+ function RovenueProvider({
7
+ client,
8
+ children
9
+ }) {
10
+ useEffect(() => {
11
+ client.startEventQueue();
12
+ return () => client.stopEventQueue();
13
+ }, [client]);
14
+ return /* @__PURE__ */ jsx(RovenueContext.Provider, { value: client, children });
15
+ }
16
+ function useRovenue() {
17
+ const client = useContext(RovenueContext);
18
+ if (!client) {
19
+ throw new Error(
20
+ "[rovenue] useRovenue() was called outside a <RovenueProvider>. Wrap the tree that uses Rovenue hooks in one, passing the client you created with configure()."
21
+ );
22
+ }
23
+ return client;
24
+ }
25
+ function useEntitlements() {
26
+ const rovenue = useRovenue();
27
+ const [entitlements, setEntitlements] = useState(() => rovenue.getCachedEntitlements());
28
+ const [isLoading, setIsLoading] = useState(true);
29
+ const [error, setError] = useState(null);
30
+ const alive = useRef(true);
31
+ const load = useCallback(async () => {
32
+ setIsLoading(true);
33
+ try {
34
+ const next = await rovenue.getEntitlements();
35
+ if (!alive.current) return;
36
+ setEntitlements(next);
37
+ setError(null);
38
+ } catch (err) {
39
+ if (!alive.current) return;
40
+ setError(err instanceof Error ? err : new Error(String(err)));
41
+ } finally {
42
+ if (alive.current) setIsLoading(false);
43
+ }
44
+ }, [rovenue]);
45
+ useEffect(() => {
46
+ alive.current = true;
47
+ void load();
48
+ return () => {
49
+ alive.current = false;
50
+ };
51
+ }, [load]);
52
+ return { entitlements, isLoading, error, refresh: load };
53
+ }
54
+ function usePlacement(identifier) {
55
+ const rovenue = useRovenue();
56
+ const [placement, setPlacement] = useState(null);
57
+ const [isLoading, setIsLoading] = useState(true);
58
+ const [error, setError] = useState(null);
59
+ const alive = useRef(true);
60
+ useEffect(() => {
61
+ alive.current = true;
62
+ setIsLoading(true);
63
+ rovenue.getPlacement(identifier).then((value) => {
64
+ if (!alive.current) return;
65
+ setPlacement(value);
66
+ setError(null);
67
+ }).catch((err) => {
68
+ if (!alive.current) return;
69
+ setError(err instanceof Error ? err : new Error(String(err)));
70
+ }).finally(() => {
71
+ if (alive.current) setIsLoading(false);
72
+ });
73
+ return () => {
74
+ alive.current = false;
75
+ };
76
+ }, [rovenue, identifier]);
77
+ return { placement, isLoading, error };
78
+ }
79
+ function useCheckout() {
80
+ const rovenue = useRovenue();
81
+ const [isStarting, setIsStarting] = useState(false);
82
+ const [error, setError] = useState(null);
83
+ const start = useCallback(
84
+ async (input) => {
85
+ setIsStarting(true);
86
+ setError(null);
87
+ try {
88
+ const session = await rovenue.checkout(input);
89
+ globalThis.location.assign(session.url);
90
+ } catch (err) {
91
+ setError(err instanceof Error ? err : new Error(String(err)));
92
+ setIsStarting(false);
93
+ }
94
+ },
95
+ [rovenue]
96
+ );
97
+ return { start, isStarting, error };
98
+ }
99
+
100
+ export { RovenueProvider, useCheckout, useEntitlements, usePlacement, useRovenue };
101
+ //# sourceMappingURL=react.js.map
102
+ //# sourceMappingURL=react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/provider.tsx","../src/react/hooks.ts"],"names":["useEffect"],"mappings":";;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,KAAK,CAAA;AAAA,MACrB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,OAAO;AAAA,GACV;AAEA,EAAA,OAAO,EAAE,KAAA,EAAO,UAAA,EAAY,KAAA,EAAM;AACpC","file":"react.js","sourcesContent":["import { createContext, useContext, useEffect, type ReactNode } from \"react\";\nimport type { Rovenue } from \"../index\";\n\n// =============================================================\n// Provider\n// =============================================================\n//\n// The client is CONSTRUCTED BY THE HOST and passed in, rather than built from\n// options here. A provider that took `{ apiKey, apiUrl }` would rebuild the\n// SDK whenever those props were reconstructed — which, given they are usually\n// written as an inline object literal, is every render. That rebuilds the\n// identity, the cache handle and the event queue each time, and the queue's\n// unload listeners would accumulate.\n//\n// Making the host own the instance also means a non-React part of the same\n// app shares one SDK rather than running a second, competing queue.\n\nconst RovenueContext = createContext<Rovenue | null>(null);\n\nexport function RovenueProvider({\n client,\n children,\n}: {\n client: Rovenue;\n children: ReactNode;\n}) {\n useEffect(() => {\n // Event flushing is a browser concern, so it starts here rather than in\n // configure(): configure() also runs during server rendering, where\n // there is nothing to listen to and nothing to flush.\n client.startEventQueue();\n return () => client.stopEventQueue();\n }, [client]);\n\n return (\n <RovenueContext.Provider value={client}>{children}</RovenueContext.Provider>\n );\n}\n\nexport function useRovenue(): Rovenue {\n const client = useContext(RovenueContext);\n if (!client) {\n // React's own message for a missing context is \"undefined is not an\n // object\", which sends the reader looking in the wrong file.\n throw new Error(\n \"[rovenue] useRovenue() was called outside a <RovenueProvider>. Wrap \" +\n \"the tree that uses Rovenue hooks in one, passing the client you \" +\n \"created with configure().\",\n );\n }\n return client;\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useRovenue } from \"./provider\";\n\nexport interface EntitlementsState {\n /** null means \"not known yet\", never \"this person has nothing\". */\n entitlements: Record<string, unknown> | null;\n isLoading: boolean;\n error: Error | null;\n refresh: () => Promise<void>;\n}\n\n/**\n * Entitlements, served from cache first.\n *\n * The initial value is the SDK's last-known cache rather than null, because\n * the alternative is a first paint that shows the paywall to someone who has\n * already paid to remove it. The network result replaces it when it arrives.\n *\n * `null` and `{}` are deliberately different: `{}` is a real answer meaning\n * the subscriber has no entitlements, `null` means we have not found out.\n * Collapsing them makes an outage indistinguishable from an unsubscribed\n * user, and that difference decides whether an app locks someone out.\n */\nexport function useEntitlements(): EntitlementsState {\n const rovenue = useRovenue();\n const [entitlements, setEntitlements] = useState<Record<\n string,\n unknown\n > | null>(() => rovenue.getCachedEntitlements());\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n // Survives unmount: setting state on an unmounted component is a leak, and\n // in StrictMode's double-mount it is also a race.\n const alive = useRef(true);\n\n const load = useCallback(async () => {\n setIsLoading(true);\n try {\n const next = await rovenue.getEntitlements();\n if (!alive.current) return;\n setEntitlements(next);\n setError(null);\n } catch (err) {\n if (!alive.current) return;\n // The cached value is left in place. Replacing it with null on a\n // transient failure would flash the paywall at a paying subscriber.\n setError(err instanceof Error ? err : new Error(String(err)));\n } finally {\n if (alive.current) setIsLoading(false);\n }\n }, [rovenue]);\n\n useEffect(() => {\n alive.current = true;\n void load();\n return () => {\n alive.current = false;\n };\n // `load` is stable for a given client, so this runs once per client and\n // not once per render — the failure that turns an SDK into a request\n // storm in production while looking fine locally.\n }, [load]);\n\n return { entitlements, isLoading, error, refresh: load };\n}\n\nexport interface PlacementState {\n placement: unknown;\n isLoading: boolean;\n error: Error | null;\n}\n\n/**\n * A placement's served content (a funnel envelope, or nothing).\n *\n * An unknown placement returns an empty envelope rather than a 404, so this\n * resolves with nothing to show instead of erroring — the caller renders\n * nothing, which is the behaviour a placement that has not been configured\n * yet should have.\n */\nexport function usePlacement(identifier: string): PlacementState {\n const rovenue = useRovenue();\n const [placement, setPlacement] = useState<unknown>(null);\n const [isLoading, setIsLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n const alive = useRef(true);\n\n useEffect(() => {\n alive.current = true;\n setIsLoading(true);\n rovenue\n .getPlacement(identifier)\n .then((value) => {\n if (!alive.current) return;\n setPlacement(value);\n setError(null);\n })\n .catch((err: unknown) => {\n if (!alive.current) return;\n setError(err instanceof Error ? err : new Error(String(err)));\n })\n .finally(() => {\n if (alive.current) setIsLoading(false);\n });\n return () => {\n alive.current = false;\n };\n }, [rovenue, identifier]);\n\n return { placement, isLoading, error };\n}\n\nexport interface CheckoutState {\n /** Starts a checkout and redirects the browser to Stripe. */\n start: (input: {\n offeringIdentifier: string;\n packageIdentifier: string;\n successUrl: string;\n cancelUrl: string;\n idempotencyKey?: string;\n }) => Promise<void>;\n isStarting: boolean;\n error: Error | null;\n}\n\n/**\n * Starts a Stripe Checkout and sends the browser to it.\n *\n * `isStarting` exists so a caller can disable the button. A second click\n * before the first session comes back would otherwise create a second\n * session — which Stripe's idempotency only prevents if the caller passes\n * the same key, and a caller that has not thought about it will not.\n */\nexport function useCheckout(): CheckoutState {\n const rovenue = useRovenue();\n const [isStarting, setIsStarting] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const start = useCallback<CheckoutState[\"start\"]>(\n async (input) => {\n setIsStarting(true);\n setError(null);\n try {\n const session = await rovenue.checkout(input);\n // Assigning rather than replacing: the buyer must be able to come\n // back to the page they left with the browser's own back button.\n globalThis.location.assign(session.url);\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsStarting(false);\n }\n },\n [rovenue],\n );\n\n return { start, isStarting, error };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@rovenue/web-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.16.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./react": {
16
+ "types": "./dist/react.d.ts",
17
+ "import": "./dist/react.js",
18
+ "require": "./dist/react.cjs"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "build": "tsup",
23
+ "test": "vitest run --minWorkers=1 --maxWorkers=2",
24
+ "docs": "typedoc"
25
+ },
26
+ "dependencies": {
27
+ "@paralleldrive/cuid2": "^2.2.2"
28
+ },
29
+ "devDependencies": {
30
+ "typedoc": "^0.28.20",
31
+ "typescript": "^5.4.0",
32
+ "vitest": "^3.2.6",
33
+ "@testing-library/react": "^16.1.0",
34
+ "@types/react": "^19.0.0",
35
+ "jsdom": "^25.0.0",
36
+ "react": "^19.0.0",
37
+ "react-dom": "^19.0.0",
38
+ "tsup": "^8.0.0"
39
+ },
40
+ "peerDependencies": {
41
+ "react": ">=18"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "react": {
45
+ "optional": true
46
+ }
47
+ },
48
+ "license": "MIT",
49
+ "description": "Rovenue Web SDK — entitlements, placements and Stripe checkout from the browser.",
50
+ "homepage": "https://rovenue.io",
51
+ "author": "Rovenue",
52
+ "module": "./dist/index.js",
53
+ "files": [
54
+ "dist"
55
+ ],
56
+ "publishConfig": {
57
+ "access": "public"
58
+ }
59
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.