Available
Authenticated browser sessions
Short-lived sessions your backend issues for one signed-in customer and one browser origin. Revocable, and never holding a server key.
Read who has paid, on your pages and on your server, with the same entitlements your iOS and Android apps already use. Connect your existing Stripe checkout.
In the browser
npm install cashsdk-web cashsdk-node
const cashsdk = createCashSDK({
publishableKey: "csk_pk_…",
environment: "production",
getSessionToken, // from your backend
});
await cashsdk.initialize();
const { entitlements } = await cashsdk.getEntitlements();
const isPro = entitlements.some((e) => e.identifier === "pro");How it works
The browser never holds a secret key and never decides who the customer is. Your backend does, the same way it already does for everything else.
Add your web app's exact origins in the dashboard, and create a publishable key and a server key.
After your own sign-in, your backend asks CashSDK for a ten-minute session for that customer and that origin.
The browser reads the customer's entitlements, subscriptions and offering with that session.
Connect Stripe. Its signed events grant, renew and end access, and the same customer is Pro on every platform.
On your server
cashsdk-node issues sessions, ends them on sign-out, checks access before you serve anything paid for, and verifies CashSDK webhooks. It runs anywhere Node.js 20.19 or 22.12 does, including Next.js route handlers, Express and NestJS.
app/api/cashsdk/session/route.ts
import { CashSDKServer } from "cashsdk-node";
const cashsdk = new CashSDKServer({
secretKey: process.env.CASHSDK_SECRET_KEY!,
environment: "production",
});
export async function POST() {
const user = await requireUser(); // your auth
const session = await cashsdk.createWebSession({
customerId: user.id,
origin: "https://app.example.com",
});
return Response.json(session, {
headers: { "Cache-Control": "no-store" },
});
}In React
cashsdk-react works with React 18 and 19 and the Next.js App Router. Server rendering shows an empty state and makes no request, and Strict Mode never duplicates a read or a purchase.
Access.tsx
"use client";
import { useEntitlements } from "cashsdk-react";
export function Access() {
const { status, isActive } = useEntitlements();
if (status !== "ready") return <p>Loading…</p>;
return isActive("pro")
? <ProFeatures />
: <Pricing />;
}Built for money
A subscription bought on the web unlocks the same entitlement as one bought in your iOS or Android app.
Connect Stripe in the Marketplace and add the customer id to your subscriptions. Nothing else changes.
The browser only holds a publishable key and a short session. Returning from checkout never grants access by itself.
Signed provider events keep access right. A late or repeated event can never shorten a paid period.
Every failure has a stable code, whether a retry can help, and a request id to quote to support.
MIT licensed, no runtime dependencies, ES modules with TypeScript types. The source is on GitHub.
Release 1.0.0
Generally available on npm.
Available
Short-lived sessions your backend issues for one signed-in customer and one browser origin. Revocable, and never holding a server key.
Available
Read the customer's entitlements, their subscriptions from every store, and the current offering, in the browser and on your server.
Available
Keep your Stripe Checkout. Connect Stripe in the Marketplace, and every subscription grants and ends access the same way App Store and Google Play purchases do, including trials, add-ons, refunds and a week of access while Stripe retries a failed renewal.
Available
A paid one-time Checkout Session unlocks lifetime products, one purchase per line item, and a full refund takes the unlock back.
Available
Pick prices from the connected Stripe account on the Products page, and CashSDK creates the matching products with the amount, currency and period Stripe states.
Available
Open Stripe's hosted portal for the signed-in customer's own Stripe account, so they can update a card or cancel: openBillingPortal in the browser, useBillingPortal in React, createBillingPortalSession on your server.
Available
Hosted Stripe Checkout for your recurring and one-time Stripe prices, with free trials from intro offers, optional promotion codes and Stripe Tax, durable retries and a return page helper.
In development
Verified PayPal payment and refund events. Access lifecycle and PayPal checkout are not available yet.
Planned
Plan changes, seats, credits, usage billing and embedded checkout.
Questions
No. Connect Stripe in the Marketplace, import your Stripe prices as products, and put your user id in the subscription's metadata as cashsdk_user_id. Stripe's events then grant and end access. One-time payments and failed renewals are covered on the Stripe page.
Yes. Use the same customer id on the web as in your mobile apps and the web SDK reads the same entitlements, whichever store the purchase came from.
It decides what to show. Your server decides what to serve: check access with cashsdk-node before returning anything paid for.
Anything that runs in a modern browser. cashsdk-react covers React 18 and 19, including the Next.js App Router. On the server, Node.js 20.19+ or 22.12+, with ES modules or CommonJS.
The SDKs are free and MIT licensed. Web revenue counts toward your CashSDK plan the same way App Store and Google Play revenue does.
Create a web app, allow your origin and read access in minutes.