SDK

Web subscriptions with the RevenueDot web SDK and Stripe Checkout

To add web subscriptions, install @revenuedot/purchases-js and call Purchases.configure with your app's key and the signed-in user's ID. Today only Test Store (test_) keys buy through the web SDK. For real web payments, send buyers to a RevenueDot purchase link or funnel, which runs Stripe Checkout in your own Stripe account. Web buyers and app users share access through the same app user ID.

Free until your app makes $10,000 a month. Switching from RevenueCat? Change one line.

The Web page in the RevenueDot dashboard showing the Stripe provider and the four-step setup checklist for web billing

One npm package

@revenuedot/purchases-js 1.67.0, imported as { Purchases }.

Tested end to end

The web SDK ran configure, offerings, a Test Store purchase and the pro entitlement against a real server.

Real payments on Stripe

Purchase links and funnels charge on your own Stripe account.

One customer

A web buyer and an app user share entitlements through the same app user ID.

Steps

How to add web subscriptions with the RevenueDot web SDK

  1. 01

    Create a free Cloud project and a Test Store app

    Start for free on RevenueDot Cloud, add a Test Store app and copy its test_ key.

  2. 02

    Create products and an offering

    Add a product with a duration and a Test Store price, an entitlement such as pro (the access your app checks) and a current offering (the products your paywall shows).

  3. 03

    Install the RevenueDot web SDK and configure it with your key

    Run npm install @revenuedot/purchases-js@1.67.0, then call Purchases.configure with your test_ key and the user's ID, as in the code below. On Cloud the SDK already points at RevenueDot, so there is nothing else to set.

  4. 04

    Buy and check the entitlement

    Call purchases.purchase({ rcPackage }). With a test_ key it opens the Test Store modal. Read customerInfo.entitlements.active.

  5. 05

    Take real payments with a purchase link

    Connect Stripe, create web products and send buyers to a purchase link with ?app_user_id= set to the same user ID. See web to app.

Install

Install the RevenueDot web SDK and configure it with your key

The RevenueDot web SDK is built from RevenueCat's open-source purchases-js (MIT license), so your code calls Purchases the same way. It sends every request, including analytics events, to RevenueDot and needs no RevenueCat account.

The SDK needs an appUserId. Pass your signed-in user's ID, or one from Purchases.generateRevenueCatAnonymousAppUserId().

Self-hosting? Pass httpConfig: { proxyURL } with your server's URL to configure. The URL must not end with a slash. purchases-js does not check response signatures, so there is no verification setting to change.

Install, then configureTerminal and TypeScript
npm install @revenuedot/purchases-js@1.67.0

// app.ts
import { Purchases } from "@revenuedot/purchases-js";

const purchases = Purchases.configure({ apiKey: "test_...", appUserId });

TypeScript

Check the entitlement, then make a test purchase

Check access and buyTypeScript
const customerInfo = await purchases.getCustomerInfo();
const isPro = "pro" in customerInfo.entitlements.active;

const offerings = await purchases.getOfferings();
const rcPackage = offerings.current?.availablePackages[0];
if (rcPackage) {
  const { customerInfo: after } = await purchases.purchase({ rcPackage });
  const nowPro = "pro" in after.entitlements.active;
}

Honest limits

Test Store and Stripe purchases work on the web today

Purchase typeWorks with RevenueDotHow
Test Store (test_ key)Yespurchases-js opens a Test Store modal
Stripe on your own accountYesRevenueDot purchase link or funnel, or your own checkout posted to the receipts endpoint
RevenueCat Web Billing (rcb_)NoRevenueDot answers error 7662. Keep those subscriptions on RevenueCat
Paddle (pdl_)Nopurchases-js cannot open a Paddle checkout against RevenueDot. Post Paddle purchases from your backend instead

Run a Stripe test-mode purchase before you go live.

Switch

Switching from RevenueCat? Keep purchases-js and change one line

If your site already uses RevenueCat's @revenuecat/purchases-js, you can keep it. Pass httpConfig.proxyURL to configure, use your RevenueDot test_ key and turn off analytics events. There is no store history to sync on the web, so there is no syncPurchases step. The full plan is in Migrate from RevenueCat.

  • Analytics: the stock SDK sends analytics events to RevenueCat even with a proxy URL, so set collectAnalyticsEvents: false. The RevenueDot web SDK sends them to RevenueDot, so you can leave it on there.
  • Same imports: install the RevenueDot web SDK under the old name with "@revenuecat/purchases-js": "npm:@revenuedot/purchases-js@1.67.0" in package.json.
  • Web Billing: subscriptions sold through RevenueCat Web Billing stay on RevenueCat. New web sales can start on RevenueDot's Stripe checkout.
Point RevenueCat's purchases-js at RevenueDotTypeScript
import { Purchases } from "@revenuecat/purchases-js";

const purchases = Purchases.configure({
  apiKey: "test_...",
  appUserId,
  httpConfig: { proxyURL: "https://api.revenuedot.app" },   // no trailing slash
  flags: { collectAnalyticsEvents: false },
});

FAQ

Web (purchases-js): questions people ask

Do I need a RevenueCat account to use the RevenueDot web SDK?

No. The RevenueDot web SDK is built from RevenueCat's open-source purchases-js under the MIT license, but every request goes to RevenueDot. Create a free RevenueDot Cloud project, add a Test Store app and pass its test_ key to Purchases.configure.

Can I take real payments through purchases-js with RevenueDot?

Not yet. Only Test Store test_ keys buy through purchases-js against RevenueDot today. Real web payments run on RevenueDot's purchase links and funnels, which use Stripe Checkout in your own Stripe account.

How do I take real subscription payments on the web with RevenueDot?

Connect your Stripe account with a restricted key, create web products, put them in an offering and share a purchase link or publish a funnel. Buyers pay on Stripe Checkout, and the purchase lands on their app user ID or a redemption link.

Can a web buyer use the mobile app too?

Yes. Entitlements belong to the customer, not to one app. Send buyers to a purchase link with app_user_id set to the same ID your app uses, and getCustomerInfo shows the entitlement in the app.

Does RevenueDot support RevenueCat Web Billing keys?

No. Receipts for rcb_ and pdl_ keys answer error 7662. Subscriptions you sell through RevenueCat Web Billing stay on RevenueCat, and new web sales can start on RevenueDot's Stripe checkout.

Get started

Start selling subscriptions in your app today.

Building and testing are free, and you can test your first purchase before you have a store account. Pro costs $0 until your apps make $10,000 a month.

Already have an account? Sign in · Switching from RevenueCat? Change one line