Skip to main content
Aurora can add Stripe payments through chat. Store your Stripe keys as secrets, then describe the payment flow that you want: a one-time checkout, subscriptions, pricing tiers, or a customer portal. Aurora writes the Stripe code as server functions inside your project, together with the pricing page and the checkout buttons. Your secret key stays on the server.

Key takeaways

  • Use Aurora chat for both subscriptions and one-time payments.
  • Never paste your Stripe Secret Key into chat. Store it in Project settings > Secrets.
  • You do not need Supabase for a simple checkout. Connect Supabase when you want to store each user’s plan or to restrict pages to subscribers.
  • Test in Stripe Test Mode before you accept live payments.
  • Deploy again after you change a secret. The live site gets secret changes only on a deploy.

Requirements

Before you add Stripe, make sure that you have:
  • A Stripe account. Create your products and prices in the Stripe Dashboard, or tell Aurora the prices that you want.
  • Two secrets in Project settings > Secrets: STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY. Both are in the Stripe Dashboard under Developers > API keys.
  • For subscriptions that are tied to user accounts: a connected Supabase project with sign-in. See Supabase Integration.
Do not put the Stripe secret key in frontend code or in a variable with the VITE_ prefix. Only server code may read the secret key.
For tests, use Stripe Test Mode. The standard test card is 4242 4242 4242 4242, with any future expiration date and any 3-digit CVC.

Set up payments in chat

1

Store your Stripe keys

Open your project. Click the project name above the chat, then click Project settings. Open Secrets and add STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY. Use the test keys first.
2

Describe the payment flow

Example prompts:
  • “Create a one-time checkout for my Digital Course at $29.”
  • “Add a pricing page with monthly and annual Premium plans. Use Stripe Checkout.”
  • “Add a customer billing portal button so subscribers can manage their plan.”
  • “Restrict the Pro dashboard to users with an active subscription.”
3

Review the result

Aurora adds the Stripe packages, writes the server functions (usually in app/server/stripe.ts), and adds the buttons to your pages. If the flow needs database tables, Aurora proposes the SQL in the chat and the project owner approves it.
4

Test, then deploy

Complete a test checkout in the preview. Then deploy the project. Before you accept live payments, replace the test keys with live keys in Secrets and deploy again.
Never paste a Stripe Secret Key into Aurora chat. Treat it like a password. If a key was exposed, create a new one in the Stripe Dashboard and replace it in Secrets.

Webhooks

A simple checkout does not need webhooks. Use webhooks when your app must react to Stripe events, for example to record that a subscription started, changed, or ended.
1

Ask Aurora for the webhook handler

Example prompt: “Add a Stripe webhook for checkout completed and for subscription created, updated, and deleted. Store each user’s active plan by Supabase user id.”Aurora writes the handler in your project. The handler checks the Stripe signature on every event. Ask Aurora for the URL path of the handler.
2

Deploy the project

Stripe must reach a public URL, so deploy the project first. The webhook URL is your live site address plus that path.
3

Create the webhook endpoint in Stripe

In the Stripe Dashboard, go to Developers > Webhooks, add an endpoint, and enter the webhook URL.
4

Select the events

Common events are:
  • checkout.session.completed
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_failed
5

Store the signing secret

Copy the webhook signing secret from Stripe. Add it in Project settings > Secrets as STRIPE_WEBHOOK_SECRET, then deploy again.
6

Verify the result

Complete a test checkout. Confirm that Stripe shows a successful delivery and that your database has the correct user, plan, and status.
If you are not sure which events or tables you need, turn on Chat mode first. Ask Aurora to explain the subscription lifecycle and to draft the tables before it changes code.

Test your integration

  • Use Stripe Test Mode for all setup and tests.
  • Test a successful payment and a failed payment.
  • If you use webhooks, confirm that the events arrive in the Stripe Dashboard and get a success response.
  • Confirm that the app shows the correct state after a checkout or a subscription change.

Troubleshooting

A secret is missing or has a different name. Open Project settings > Secrets and check STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY. On the live site, deploy again after you add a secret.
In Chrome, right-click the page, choose Inspect, then open the Console and Network tabs. Look for the failed request. Copy the exact error into the chat and ask Aurora to find the cause.
In the Stripe Dashboard, go to Developers > Webhooks and open your endpoint. Review the recent deliveries and their response codes. After you fix a problem, resend the failed events from Stripe.
The signing secret does not match. Copy the signing secret of this endpoint from Stripe again, save it as STRIPE_WEBHOOK_SECRET, and deploy again. Test mode and live mode have different secrets.
Turn on Chat mode and describe the flow step by step: what you clicked, what you expected, and what happened. Include errors from the browser or from Stripe. When the cause is clear, turn Chat mode off and ask Aurora to make the fix.