> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rocket.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Stripe

> Connect Stripe to your Rocket.new app and accept payments, subscriptions, and donations with a single prompt.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

Connect Stripe and describe the payment flow you want in chat. Rocket generates the complete checkout experience: pricing pages, payment forms, webhook handlers, and subscription management.

<Divider />

## What you can do

<CardGroup cols={2}>
  <Card title="SaaS subscription billing" icon="repeat">
    Monthly or yearly plans with automatic billing, upgrades, downgrades, and cancellation.
  </Card>

  <Card title="One-time product checkout" icon="cart-shopping">
    Sell digital products, courses, templates, or physical goods with a simple checkout flow.
  </Card>

  <Card title="Accept donations" icon="hand-holding-heart">
    One-time or recurring donations with preset or custom amounts.
  </Card>

  <Card title="Multi-product checkout" icon="store">
    Cart-based checkout with multiple line items, quantities, and a single Stripe payment session.
  </Card>
</CardGroup>

<Divider />

## Before you connect

You need your **Secret key** and **Publishable key** from the Stripe Dashboard.

<Card icon="link" horizontal href="https://dashboard.stripe.com/apikeys" arrow="true">
  **Open your Stripe API keys in the Stripe Dashboard**
</Card>

| Key type            | Prefix | Usage                                     |
| :------------------ | :----- | :---------------------------------------- |
| **Publishable key** | `pk_`  | Safe to use on the client side            |
| **Secret key**      | `sk_`  | Server side only - keep this confidential |

Keys come in two modes. Always start with **Test keys** and switch to **Live keys** only when you are ready to accept real payments.

<Warning>
  Never paste your Stripe keys directly into chat. Always use the secure connection popup. If your Secret key has been exposed, rotate it immediately from the [Stripe Dashboard](https://dashboard.stripe.com/apikeys).
</Warning>

<Note>
  Stripe works best paired with [Supabase](/build/connectors/supabase/overview) for user accounts. Rocket links Stripe customers to authenticated Supabase users automatically.
</Note>

<Divider />

## Connect Stripe

<Tabs>
  <Tab title="Web Browser">
    You can connect from two places - both open the same popup.

    **Option 1: From chat**

    Type a prompt that mentions Stripe - for example, `Connect Stripe and add a $49 one-time checkout`. Rocket detects the intent and shows a **Connect** button inline. Click it and the popup opens.

    <Frame caption="Stripe connection prompt in chat">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-chat-light.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=d07286c66c52022727dfde9e56fa8955" alt="Stripe connection prompt in the Rocket chat panel." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/stripe/web-browser/stripe-chat-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-chat-dark.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=a6f39334468d910aa51b812007337000" alt="Stripe connection prompt in the Rocket chat panel." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/stripe/web-browser/stripe-chat-dark.webp" />
    </Frame>

    **Option 2: From the Connectors tab**

    Click the **`...`** button in the preview toolbar, then select **Connectors**.

    <Frame caption="Open Connectors from the toolbar">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-light.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=7bd785a0e878564054e08328b2aa3d6b" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-dark.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=d047040372d776cb47e4e483de8eeb8d" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-dark.webp" />
    </Frame>

    Click the **Stripe** card, then click **Connect**.

    <Frame caption="Stripe card in the Connectors panel">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-connectors-tab-light.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=c2c957a1381219d168513c093fa37120" alt="Connectors tab showing the Stripe card with a Connect button." className="theme-image light-image" width="1804" height="538" data-path="images/build-docs/connectors/stripe/web-browser/stripe-connectors-tab-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-connectors-tab-dark.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=087c76bfd75bad408a02e220203ec9f0" alt="Connectors tab showing the Stripe card with a Connect button." className="theme-image dark-image" width="1804" height="534" data-path="images/build-docs/connectors/stripe/web-browser/stripe-connectors-tab-dark.webp" />
    </Frame>

    **After clicking Connect**

    A popup opens. Paste your **Secret key** and **Publishable key**, then click **Save**. A green dot appears next to Stripe when the connection is active.

    <Frame caption="Paste your Stripe keys in the popup">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-popup-light.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=6aeb408d72f3a72a65c70e061f2eecaf" alt="Stripe API key input popup." className="theme-image light-image" width="840" height="640" data-path="images/build-docs/connectors/stripe/web-browser/stripe-popup-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-popup-dark.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=a1458db0cd0f4dbcf89604953be0be9b" alt="Stripe API key input popup." className="theme-image dark-image" width="840" height="640" data-path="images/build-docs/connectors/stripe/web-browser/stripe-popup-dark.webp" />
    </Frame>

    **Update or disconnect**

    Go to [**Connectors > Stripe**](#connect-stripe). Update your keys or click **Disconnect** to remove the integration.

    <Frame caption="Disconnect Stripe">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-disconnect-light.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=17b9a64b8f71923fc32e0d9a28064b10" alt="Stripe integration showing connected state with a Disconnect button." className="theme-image light-image" width="1804" height="534" data-path="images/build-docs/connectors/stripe/web-browser/stripe-disconnect-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/k_lIa1i20gEzZSTP/images/build-docs/connectors/stripe/web-browser/stripe-disconnect-dark.webp?fit=max&auto=format&n=k_lIa1i20gEzZSTP&q=85&s=0fe5b60a6aa2d7dd2b95d9790e227666" alt="Stripe integration showing connected state with a Disconnect button." className="theme-image dark-image" width="1804" height="534" data-path="images/build-docs/connectors/stripe/web-browser/stripe-disconnect-dark.webp" />
    </Frame>
  </Tab>

  <Tab title="Mobile App">
    You can connect from two places - both open the same popup.

    **Option 1: From chat**

    Type a prompt that mentions Stripe. Rocket detects the intent, shows a **Connect** button, and the popup opens when you tap it.

    **Option 2: From the Connectors tab**

    1. Tap the **More** button in the header.
    2. Tap **Integrations**.
    3. Tap the **Stripe** card, then tap **Connect**.

    **After tapping Connect**

    A popup opens. Paste your **Secret key** and **Publishable key**, then tap **Done**. A green dot appears next to Stripe when the connection is active.

    **Update or disconnect**

    Go to **Integrations > Stripe**. Update your keys or tap **Disconnect** to remove the integration.
  </Tab>
</Tabs>

<Divider />

## Example prompts

| Use case            | Prompt                                                                                       |
| ------------------- | -------------------------------------------------------------------------------------------- |
| Simple checkout     | `Add a Stripe checkout for my $49 product with a success page.`                              |
| Subscription plans  | `Create a pricing page with Free, Pro ($19/mo), and Enterprise ($99/mo) tiers using Stripe.` |
| Donations           | `Add Stripe donation buttons with $5, $10, $25, $50 options and a custom amount field.`      |
| Free trial          | `Add a 14-day free trial to the Pro plan. Charge $19/month after the trial ends.`            |
| Invoices            | `Generate and email a PDF invoice to the customer after each Stripe payment.`                |
| Coupon codes        | `Add a coupon code field to the checkout page that applies a Stripe discount.`               |
| Refund flow UI      | `Add a "View Orders" page with order history and a link to the Stripe customer portal.`      |
| Usage-based billing | `Track API calls per user and charge $0.01 per call using Stripe metered billing.`           |

<Divider />

## Tips

* **Always start with Test mode keys.** Switch to Live keys only when you are ready to accept real payments. Test card: `4242 4242 4242 4242`.
* **Connect Supabase first.** Rocket links Stripe customers to Supabase user accounts. Connect Supabase before connecting Stripe.
* **Webhooks are handled automatically.** Rocket sets up the necessary webhook handlers for events like `checkout.session.completed` and `customer.subscription.updated`.
* **Refunds and disputes live in Stripe.** Manage refunds, disputes, and financial reporting directly from the Stripe Dashboard.
* **One set of keys per task.** Each Rocket task connects to a single set of Stripe API keys. You can use the same Stripe account across multiple tasks.

<Divider />

## What's next?

<CardGroup cols={2}>
  <Card title="Supabase" icon="database" href="./supabase">
    Stripe requires Supabase for user accounts. Set it up if you have not already.
  </Card>

  <Card title="Resend" icon="envelope" href="./resend">
    Send order confirmation and receipt emails automatically after Stripe payments.
  </Card>

  <Card title="Google Analytics" icon="chart-line" href="./google-analytics">
    Track checkout conversion rates and revenue with GA4 e-commerce events.
  </Card>

  <Card title="Build a SaaS app" icon="book" href="/learn/recipes/saas">
    Full recipe: Supabase + Stripe + Resend + Netlify to build a complete SaaS product.
  </Card>
</CardGroup>
