Setup
We'll need to configure Stripe to handle test payments. If you don't already have a Stripe account, create one now.
For the following steps, make sure you have the "Test Mode" toggle switched on:
- Create a stripe account and set it up
- Create a product
- Go to portal settings and click "Save Changes"
- Go to Supabase dashboard > Edge Functions and copy the
stripe_webhooksURL. It should look something like below:
![]()
- Add stripe webhook,
- Click
Select eventsunder theSelect events to listen toheading. - Click
Select all eventsin theSelect events to sendsection. - Copy
Signing secretas we'll need that in the next step (e.gwhsec_xxx)
- Get your Stripe API secret key and update
STRIPE_SECRET_KEYin.env - Get the signing webhook signing secret and update
STRIPE_WEBHOOK_SIGNING_SECRETin.env - Set your secrets in production
supabase secrets set --env-file .env
info
You can follow steps 1-7 in the Stripe test environment to have your local environment use the stripe test environment. Update .env.local instead of .env.
note
After setting up the webhooks, you can run the command below to do an initial sync between your supabase and stripe database
deno run --env -A supabase/functions/_scripts/sync-stripe.ts