---
title: "Stripe · Nuxt Scripts"
description: "Use Stripe in your Nuxt app."
canonical_url: "https://scripts.nuxt.com/scripts/v0/payments/stripe"
meta:
  "og:description": "Use Stripe in your Nuxt app."
  "og:image": "https://scripts.nuxt.com/_og/d/c_Docs%2Ctitle_Stripe%2Cdescription_Use%2BStripe%2Bin%2Byour%2BNuxt%2Bapp.%2Cheadline_Payments%2Cp_Ii9zY3JpcHRzL3YwL3BheW1lbnRzL3N0cmlwZSI%2Cs_Xkf0QcA3psI7Z3P2.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Stripe · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/d/c_Docs%2Ctitle_Stripe%2Cdescription_Use%2BStripe%2Bin%2Byour%2BNuxt%2Bapp.%2Cheadline_Payments%2Cp_Ii9zY3JpcHRzL3YwL3BheW1lbnRzL3N0cmlwZSI%2Cs_Xkf0QcA3psI7Z3P2.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Payments**

# **Stripe**

[Copy for LLMs](https://scripts.nuxt.com/scripts/v0/payments/stripe.md)

[**Stripe**](https://stripe.com) is a popular payment gateway that allows you to accept payments online.

Nuxt Scripts provides two Stripe features:

- `**useScriptStripe**` composable which loads the script `**https://js.stripe.com/v3/**`.
- `**ScriptStripePricingTable**` component that allows you to embed a [**Stripe Pricing Table**](https://docs.stripe.com/payments/checkout/pricing-table) on your site using `**https://js.stripe.com/v3/pricing-table.js**`.

## Types

To use the Stripe with full TypeScript support, you will need to install the `**@stripe/stripe-js**` dependency.

```bash
pnpm add -D @stripe/stripe-js
```

## Loading Globally

Stripe recommends loading their script globally on your app to improve fraud detection.

```ts
export default defineNuxtConfig({
  scripts: {
    registry: {
      stripe: true,
    }
  }
})
```

## ScriptStripePricingTable

The `**ScriptStripePricingTable**` component allows you to embed a [**Stripe Pricing Table**](https://docs.stripe.com/payments/checkout/pricing-table) on your site in an optimized way.

To improve performance it will load the table when it's visible using the [**Element Event Triggers**](https://scripts.nuxt.com/docs/v0/guides/script-triggers#element-event-triggers).

You'll need to create your own [**Pricing Table**](https://dashboard.stripe.com/pricing-tables) before proceeding.

### Demo

### Component API

See the [**Facade Component API**](https://scripts.nuxt.com/docs/v0/guides/facade-components#facade-components-api) for full props, events, and slots.

### Props

The `**ScriptStripePricingTable**` component accepts the following props:

- `**trigger**`: The trigger event to load the Stripe. Default is `**mouseover**`. See [**Element Event Triggers**](https://scripts.nuxt.com/docs/v0/guides/script-triggers#element-event-triggers) for more information.
- `**pricing-table-id**`: The ID of the Pricing Table you created in the Stripe Dashboard.
- `**publishable-key**`: Your Stripe publishable key.
- `**client-reference-id**`: A unique identifier for the client.
- `**customer-email**`: The email of the customer.
- `**customer-session-client-secret**`: The client secret of the customer session.

## useScriptStripe

The `**useScriptStripe**` composable lets you have fine-grain control over the Stripe SDK. It provides a way to load the Stripe SDK and interact with it programmatically.

```ts
export function useScriptStripe<T extends StripeApi>(_options?: StripeInput) {}
```

Please follow the [**Registry Scripts**](https://scripts.nuxt.com/docs/v0/guides/registry-scripts) guide to learn more about advanced usage.

### Options

```ts
export const StripeOptions = object({
  advancedFraudSignals: optional(boolean()),
})
```

### StripeApi

```ts
export interface StripeApi {
  Stripe: stripe.StripeStatic
}
```

## Example

Loading the Stripe SDK and using it to create a payment element.

```vue
<script setup lang="ts">
const paymentEl = ref(null)
const { onLoaded } = useScriptStripe()
onMounted(() => {
  onLoaded(({ Stripe }) => {
    const stripe = Stripe('YOUR_STRIPE_KEY')
    const elements = stripe.elements()
    const paymentElement = elements.create('payment', { /* pass keys */})
    paymentElement.mount(paymentEl.value)
  })
})
</script>

<template>
  <div ref="paymentEl" />
</template>
```

[Edit this page](https://github.com/nuxt/scripts/edit/0.x/docs/content/payments/stripe.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/v0/payments/stripe.md)

[**PayPal** Use PayPal in your Nuxt app.](https://scripts.nuxt.com/scripts/v0/payments/paypal) [**Crisp** Show performance-optimized Crisp in your Nuxt app.](https://scripts.nuxt.com/scripts/v0/support/crisp)

**On this page **

- [Types](#types)
- [Loading Globally](#loading-globally)
- [ScriptStripePricingTable](#scriptstripepricingtable)
- [useScriptStripe](#usescriptstripe)
- [Example](#example)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/v0/payments/stripe#webpage","@type":"WebPage","description":"Use Stripe in your Nuxt app.","name":"Stripe","url":"https://scripts.nuxt.com/scripts/v0/payments/stripe","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/v0/payments/stripe#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/v0/payments/stripe"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/v0/payments/stripe#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"V0","item":"https://scripts.nuxt.com/scripts/v0","position":3},{"@type":"ListItem","name":"Payments","item":"https://scripts.nuxt.com/scripts/v0/payments","position":4},{"@type":"ListItem","name":"Stripe","item":"https://scripts.nuxt.com/scripts/v0/payments/stripe","position":5}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
