GitHub

Vanilla JS Quick start

Web uses stripe-pwa-elements custom elements. Install the peer dependency and register the elements once during bootstrap, before you present Stripe UI.

npm install stripe-pwa-elements
import { defineCustomElements } from 'stripe-pwa-elements/loader';
import { Stripe } from '@capacitor-community/stripe';

defineCustomElements();

await Stripe.initialize({
  publishableKey: 'Your Publishable Key',
});

stripe-pwa-elements is a Stencil library. If you need the loader details, see the Stencil documentation.

Web PaymentSheet and PaymentFlow render a card modal, not the native Stripe PaymentSheet. Apple Pay and Google Pay use the Payment Request Button and require HTTPS. Many native-only options such as defaultBillingDetails, billingDetailsCollectionConfiguration, enableApplePay, and enableGooglePay are ignored on web.

Edit this page on GitHub