API reference
Every export of @vue-stripe/vue-stripe: components, composables, the plugin and types. To find the export that wraps a Stripe.js method or element, use Stripe.js coverage. Exported TypeScript types and the error classes are listed in Types and errors.
Compatibility
| Requirement | Supported |
|---|---|
| Vue | ^2.7.0 || ^3.0.0 (peer dependency). Vue 2.7 is tested in client-side apps; see Use Vue Stripe on Vue 2.7 |
| Stripe.js | @stripe/stripe-js ^10.3.0, Stripe.js Endive (peer dependency; public types include the Pricing SDK (10.2.1) and the Payment Element fieldchange event (10.3.0)) |
| Rendering | Client and server. Stripe.js loads only in the browser; during server rendering, components render their loading state and hydrate without mismatches. <ClientOnly> is optional. See Use Vue Stripe with Nuxt and SSR |
| Module formats | ES, CommonJS and UMD builds (the UMD build, for a <script> tag, includes the @stripe/stripe-js loader and needs only the Vue and vue-demi globals; see Without a bundler); TypeScript declarations for ES module and CommonJS consumers, with moduleResolution bundler, node16, nodenext or node |
| TypeScript | 5.0 or later for the declarations (they use export type *). Vue 3.5's own declarations need 5.4 when skipLibCheck is false, and vue-tsc 3 needs 5.0 |
| Stylesheet | @vue-stripe/vue-stripe/style.css, imported once per app |
| Browsers | The browsers Stripe.js supports. The guides' flows (Payment Element, Card Element, hosted, Embedded and Checkout Elements, and their return pages) were tested in Chromium, Firefox and WebKit (Safari's engine), on desktop and in iPhone and Android phone profiles, in development and production builds. The ES and CommonJS builds use ES2020 syntax; an app that targets older browsers transpiles them in its own build |
Components
Provider components
| Component | Description |
|---|---|
| VueStripeProvider | Loads Stripe.js and provides the Stripe instance |
| VueStripeElements | Creates a StripeElements instance and provides it to element components |
Element components
| Component | Description |
|---|---|
| VueStripePaymentElement | Payment Element: cards, wallets, bank debits and local payment methods |
| VueStripeExpressCheckoutElement | Express Checkout Element: Apple Pay, Google Pay, Link and other wallet buttons |
| VueStripeCardElement | Card Element: number, expiry and CVC in one field |
| Split Card Elements | VueStripeCardNumberElement, VueStripeCardExpiryElement, VueStripeCardCvcElement |
| VueStripeAddressElement | Address Element: shipping or billing address |
| VueStripeLinkAuthenticationElement | Link Authentication Element: email and Link sign-in |
| VueStripePaymentMethodMessagingElement | Payment Method Messaging Element: buy-now-pay-later messaging |
| VueStripeTaxIdElement | Tax ID Element: business name and tax ID (Checkout Sessions) |
| VueStripeCurrencySelectorElement | Currency Selector Element (Checkout Sessions, Adaptive Pricing) |
| VueStripeContactDetailsElement | Contact Details Element: customer email (Checkout Sessions or Elements) |
| VueStripeTermsElement | Terms Element: terms the customer accepts (Stripe beta) |
| VueStripeLinkSignupElement | Link Signup Element: save details to Link (Stripe beta) |
Regional elements
| Component | Description |
|---|---|
| VueStripeIbanElement | IBAN Element: SEPA Direct Debit |
| VueStripeAuBankAccountElement | AU Bank Account Element: BECS Direct Debit (Australia) |
Stripe.js Clover (8.0) removed the standalone iDEAL, P24, EPS and FPX elements. The Payment Element collects these payment methods.
Issuing elements
| Component | Description |
|---|---|
| Issuing Elements | VueStripeIssuingCardNumberDisplayElement, ...CvcDisplayElement, ...ExpiryDisplayElement, ...PinDisplayElement, ...CopyButtonElement, ...AddToWalletButtonElement: issued card details in Stripe-hosted iframes |
Checkout and subscriptions
| Component | Description |
|---|---|
| VueStripeCheckout | Redirects to Stripe Checkout (Checkout Session URL) |
| VueStripeEmbeddedCheckout | Embedded Checkout (stripe.createEmbeddedCheckoutPage()) |
| VueStripeCheckoutElementsProvider | Checkout Elements SDK: Elements on a Checkout Session. VueStripeCheckoutProvider is a deprecated alias. |
| VueStripeCheckoutFormProvider | Checkout Form SDK, ui_mode: 'form' (beta, requires Stripe access) |
| VueStripeCheckoutForm | Checkout Form: Stripe's complete checkout form in one element (beta, requires Stripe access) |
| VueStripePricingTable | Embedded Stripe pricing table |
Disclosures
| Component | Description |
|---|---|
| VueStripeFinancialAccountDisclosure | Legal text for Financial Accounts for platforms |
| VueStripeIssuingDisclosure | Legal text for Issuing card programs |
| VueStripeTreasuryDisclosure | Legal text for Treasury financial accounts |
Composables
| Composable | Description |
|---|---|
| useStripe | The Stripe instance and its loading and error state |
| useStripeElements | The StripeElements instance, getElement, submit and fetchUpdates (alias: useElements) |
| usePaymentIntent | stripe.confirmPayment() with the Elements group; runs elements.submit() first |
| useSetupIntent | stripe.confirmSetup() with the Elements group; runs elements.submit() first |
| useStripeCheckout | Redirects to Stripe Checkout (alias: useCheckout) |
| useCheckoutSession | Checkout Session state and actions inside VueStripeCheckoutElementsProvider |
| useCheckoutForm | Checkout Form state, session and confirm inside VueStripeCheckoutFormProvider (beta) |
| useCreatePaymentMethod | stripe.createPaymentMethod() |
| useHandleNextAction | stripe.handleNextAction(): 3D Secure and other next actions |
| useCreateConfirmationToken | stripe.createConfirmationToken() from the Payment Element |
| useCreateToken | stripe.createToken(): card, bank account, PII, Connect account or person |
| useHandleCardAction | stripe.handleCardAction() for manually confirmed PaymentIntents (legacy) |
| useVerifyMicrodepositsForPayment | stripe.verifyMicrodepositsForPayment() |
| useVerifyMicrodepositsForSetup | stripe.verifyMicrodepositsForSetup() |
| useRadarSession | stripe.createRadarSession() |
| useEphemeralKeyNonce | stripe.createEphemeralKeyNonce() for Issuing elements |
| useFinancialConnections | Financial Connections and US bank account collection |
| useIdentity | stripe.verifyIdentity(): the Stripe Identity modal |
| usePaymentRequest | stripe.paymentRequest() behind your own button |
| usePricing | Explicit stripe.initializePricing() and the Pricing SDK for localized prices, currencies and tokens (Stripe beta; not yet verified end to end) |
Method confirmers
One composable per Stripe.js confirm<Method>Payment and confirm<Method>Setup method, such as useConfirmCardPayment and useConfirmSepaDebitSetup. The method confirmers overview lists all of them and their shared return value.
| Page | Payment methods |
|---|---|
| Cards | Card |
| Bank debits | ACSS, AU BECS, Bacs, SEPA, US bank account |
| Redirects and bank transfers | Bancontact, EPS, FPX, giropay, iDEAL, Przelewy24, Sofort, Pay by Bank, Multibanco, customer balance |
| Wallets | Alipay, Amazon Pay, BLIK, Cash App Pay, GrabPay, MobilePay, PayNow, PayPal, Pix, PromptPay, TWINT, WeChat Pay |
| Buy now, pay later | Affirm, Afterpay / Clearpay, Billie, Klarna |
| Vouchers | Boleto, Konbini, OXXO |
Plugin
| Export | Description |
|---|---|
| createVueStripe | Vue plugin that provides Stripe to the whole app, in place of VueStripeProvider |
loadStripe | A wrapper around the @stripe/stripe-js/pure loader, with the same signature and setLoadParameters. It shares one Stripe.js load with every provider on the page, creates a new Stripe instance on every call, and registers Vue Stripe's app info (stripe.registerAppInfo()) on it. See How Stripe.js is loaded |
