Sell subscriptions on the web with Stripe checkout and entitlements that unify with mobile.
The Web SDK is on the roadmap and is not published yet.cashsdk-web does not
resolve from any registry today, so the code on this page describes the
intended API rather than a package you can install.
Shipping now? Use the iOS or Android SDK, which are
available today. To be notified when this one lands, contact
support@cashsdk.com.
The CashSDK Web SDK brings the same offerings-and-entitlements API to the
browser. Purchases run through a web processor (Stripe checkout by default)
and the entitlements they grant are the same ones your mobile apps read.
Web purchases use a web processor (Stripe, and other supported providers)
rather than an app store. When you call identify with the same
app_user_id, entitlements bought on the web unify with those bought on iOS
and Android: one customer, one set of entitlements everywhere.
Pass a package to purchase. The SDK opens Stripe checkout, and on return
CashSDK validates the payment and resolves with the customer's updated
entitlements.
ts
const result = await CashSDK.purchase(offering.monthly);
if (result.entitlements.pro?.isActive) {
unlockPro();
}
Link the SDK to your own user ID. This is what unifies web and mobile purchases:
sign a customer in on the web with the same ID they use in your app, and their
entitlements line up automatically.