๐ณ Stripe
Add payment processing keys to your environment.
โ ๏ธ Don't want to use Stripe? If you don't need payment processing, you can remove Stripe by:
- Remove
ExpoStripeProvider
from your app layout (app/_layout.tsx
):
// Remove this wrapper:
// <ExpoStripeProvider>
// Keep only:
<RevenueCatProvider>
<QueryClientProvider client={queryClient}>
<ThemeProvider>
<AuthProvider>
<AppInitializer>
{/* Your app content */}
</AppInitializer>
</AuthProvider>
</ThemeProvider>
</QueryClientProvider>
</RevenueCatProvider>
- Remove Stripe plugin from
app.json
- delete this entire plugin block:
// Remove this entire block:
[
"@stripe/stripe-react-native",
{
"merchantIdentifier": "merchant.com.your.app",
"publishableKey": "pk_test_your_publishable_key_here"
}
]
- Skip this entire setup page
๐ Create Stripe Account
1. Sign Up
- Go to stripe.com
- Create your account
- Complete business verification (for live payments)
2. Get API Keys
- Go to Developers โ API Keys
- Copy your Publishable key to
.env.local
:
EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key
- Copy your Secret key to
supabase/functions/.env
:
STRIPE_SECRET_KEY=sk_test_your_secret_key
๐ Setup Webhooks
1. Create Webhook Endpoint
- Go to Developers โ Webhooks
- Click "Add endpoint"
- URL: Use your Supabase URL from step 2:
https://your-project-id.supabase.co/functions/v1/stripe-webhook
- Select events:
payment_intent.succeeded
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
- Click "Add endpoint"
2. Get Webhook Secret
- Click on your created webhook
- Copy the Signing secret and add it to your
supabase/functions/.env
file:
Add the Stripe secret keys to your supabase/functions/.env
file:
STRIPE_SECRET_KEY=sk_test_your_secret_key
STRIPE_WEBHOOKS_SECRET=whsec_your_webhook_secret
๐ Configure Apple Merchant ID
1. Create Merchant ID in Apple Developer
- Go to Apple Developer Console
- Certificates, Identifiers & Profiles โ Identifiers
- Click "+" โ Merchant IDs
- Create merchant ID:
merchant.com.your.app
- Description: "Your App Payments"
- Register and Done
2. Configure app.json
Add the Stripe plugin to your app.json
:
{
"expo": {
"plugins": [
[
"@stripe/stripe-react-native",
{
"merchantIdentifier": "merchant.com.your.app",
"publishableKey": "pk_test_your_publishable_key_here"
}
]
]
}
}
- Replace
merchant.com.your.app
with your actual merchant ID - Replace
pk_test_your_publishable_key_here
with your Stripe publishable key from step 2
3. Rebuild Native Code
After modifying app.json
, rebuild the native code:
# Clean rebuild to apply plugin changes
npx expo prebuild --clean
Important: This step is required whenever you modify plugins in app.json
.
โ Environment Updated
Your .env.local
should now include:
EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
Your supabase/functions/.env
should now include:
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOKS_SECRET=whsec_...
๐ฏ Next Step
Continue to ๐ง Resend to setup email service.
Step 7/11 Complete โ
Stripe payments configured!
๐ Additional Resources
Official Documentation
- ๐ Expo Stripe SDK Documentation - Complete guide to using Stripe with Expo
Video Tutorials
- ๐ฅ Stripe Integration Tutorial - Step-by-step video guide for Stripe setup