Skip to main content

Does the web SDK does not support in-app purchases, user management, or most of the methods ?

Hey ​@arnav-raj-f8b666 ,

The Web SDK does support in-app purchases and user management, but it's designed specifically for the web (not for native app stores like Apple or Google Play).

What it supports:

  • In-app purchases via Stripe: full checkout flow using Stripe Elements, Apple Pay, etc.

  • User management: supports both anonymous and identified users via appUserId, with methods like configure(), changeUser(), and getCustomerInfo()

  • Core SDK methods: includes getOfferings(), purchase(), and entitlement checks via getCustomerInfo()

What it doesn’t support:

  • Native store integrations: no App Store or Play Store purchases

  • restorePurchases(): not needed on web, use getCustomerInfo() instead

  • Receipt validation: not applicable; Stripe handles payment status directly

These differences are by design, to reflect the SDK’s web-first architecture in comparison to the mobile ones! 

More info: Web SDK

Best,


I am not able to use configure(). I have installed the latest SDK 1.6.0
npm list @revenuecat/purchases-js
vite-react-typescript-starter@0.0.0 /Users/Downloads/project
└── @revenuecat/purchases-js@1.6.0

 

Below is my code snippet

import * as Purchases from '@revenuecat/purchases-js';

import { PurchasesOffering, PurchasesPackage, CustomerInfo, PurchasesError } from '@revenuecat/purchases-js';

 

// RevenueCat configuration

const REVENUECAT_PUBLIC_KEY = 'revenuecatpublickey';

 

// RevenueCat REST API configuration

const REVENUECAT_API_BASE = 'https://api.revenuecat.com/v1';

const REVENUECAT_PROJECT_ID = 'myprojectid'; // I have replaced this with my actual projectid

const REVENUECAT_API_KEY = 'revenuecatapikey'; // Using the provided API key

 

// Entitlement configuration

const PREMIUM_ENTITLEMENT_ID = 'myentitlementid'; // Your RevenueCat entitlement ID

 

// Initialize RevenueCat

let isInitialized = false;

 

export async function initializeRevenueCat(userId?: string): Promise<void> {

if (isInitialized) return;

 

try {

await Purchases.configure(REVENUECAT_PUBLIC_KEY, userId);

isInitialized = true;

console.log('RevenueCat initialized successfully with user:', userId);


Hey ​@arnav-raj-f8b666 ,

You're using version 1.6.0, but the syntax you're using (Purchases.configure(apiKey, userId)) was only added in version 1.7.0.

You could either update to latest version (recommended) and then your

  await Purchases.configure(REVENUECAT_PUBLIC_KEY, userId);

will work, or you could use the syntax for v1.6.0:

await Purchases.configure({
apiKey: REVENUECAT_PUBLIC_KEY,
appUserId: userId
});

That should fix the issue you’re seeing, but let me know if something else is still not working!

Best,


Reply