Skip to main content
Question

How do I implement web billing using the sdk?


Forum|alt.badge.img

I’m trying to implement web billing on my site but the documentation is extremely sparse. As far as I can see it only outlines the javascript sdk calls but I can’t find anything on how to integrate it into my site. If someone is going to sign-up using a credit card how do I pass that information. The documentation completely skips over this.

 

 

Do you have a clear example of how this whole thing works? How do I integrate stripe and apple pay and google pay to actually use Web Billing.

 

It seems to only option at this point is to use the hosted page.

antonio
RevenueCat Staff
Forum|alt.badge.img+4
  • RevenueCat Staff
  • March 31, 2025

Hi @Brighttank,

 

Thanks for the feedback — and great question.

The Web Billing SDK (purchases-js) uses Stripe Elements under the hood to handle payment collection, so you don’t need to build your own form or manually collect credit card details. When you call the purchase method, a payment sheet is rendered on your site where the customer can securely enter their information. The SDK manages this flow for you.

So in most cases, you don’t need to do anything special to collect the payment method — it’s all handled by the SDK. That said, if you’re trying to reuse payment data you’ve already collected outside of RevenueCat, that isn’t currently supported.

 

We also have a demo app in the repository that shows how this works end-to-end: https://github.com/RevenueCat/purchases-js/tree/main/examples/webbilling-demo 

 

If you’re looking to configure Apple Pay or Google Pay, you can find the relevant setup steps in our documentation:

https://www.revenuecat.com/docs/web/web-billing/payment-methods#configuring-apple-pay–google-pay 

 

Hope this helps — let us know if anything’s still unclear or if you’re working with a specific setup we can help with.


Forum|alt.badge.img

Thanks for the response. I would suggest adding the part about the form being rendered by the sdk to the documentation along with a note that the purchase method contains an htmlElement parameter that can be used to configure where it is rendered.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings