Userbase

Docs : SDK : purchaseSubscription

purchaseSubscription redirects your users to a Stripe Checkout form, a Stripe-hosted payment page designed to reduce friction accepting payment from your users. To call this function, you must first do the following:

    
      userbase.purchaseSubscription({
        successUrl: 'https://example.com/success',
        cancelUrl: 'https://example.com/cancel'
      }).then(() => {
        // user successfully redirected to Stripe Checkout form
      }).catch((e) => console.error(e))
    
  

Parameters

Notes

Errors