I’m building a web-based TV app where users scan a QR code on the TV to complete payment on their phone. I’m using purchases-js and calling getOfferings() to display products for the current offering.
However, the packages array is coming back empty, even though I’ve created a Stripe product for each package under each offering.
I noticed that when I add a Web Billing product, it shows up correctly in the offerings, but the Stripe products do not appear.
Is this expected behavior for the Web SDK, or am I missing a required configuration step for Stripe products to be available through getOfferings() in a web application?
Best answer by alejandra-wetsch
Hey @hattapoglu,
Apologies for the delayed response!
To add more context, the ability to use Stripe Billing API Keys in the Web SDK (purchase-js) was added in recent versions (1.31.0 upwards). While checking some internal logs, it appears you’re currently using version 1.24.3. Is that correct? If that’s the case, I would recommend upgrading to the latest version (1.42.1), which includes support for Stripe Billing API Keys and other improvements.
If you still see this error after upgrading your SDK version, please create a support ticket referencing this community post so that we can provide quicker support and share internal information.
That’s expected behavior. To add more context, the RevenueCat SDKs scope the Offerings and products that can be fetched based on the API Key used to configure the SDK. When you configure the Web SDK with a Web Billing API Key, you can only fetch Web Billing products.
Given that you want to fetch Stripe Products via the Web SDK, you will need to use the Public API Key from your Stripe Billing configuration to configure the SDK. This means that instead of using an rcb_***** API Key, you will need a strp_***** one.
However, when I configure the SDK with the strp_***** key I get this error at runtime:
▎ RevenueCat: Oe: Invalid API key. Use your Web Billing API key.
The purchases-js SDK itself is rejecting the Stripe key and requiring an rcb_***** key. So either the SDK needs to be updated to accept strp_***** keys, or there's a different approach needed here. Could you clarify how to actually use Stripe products with purchases-js given this constraint?
To add more context, the ability to use Stripe Billing API Keys in the Web SDK (purchase-js) was added in recent versions (1.31.0 upwards). While checking some internal logs, it appears you’re currently using version 1.24.3. Is that correct? If that’s the case, I would recommend upgrading to the latest version (1.42.1), which includes support for Stripe Billing API Keys and other improvements.
If you still see this error after upgrading your SDK version, please create a support ticket referencing this community post so that we can provide quicker support and share internal information.