Stripe Setup
Set up Stripe for payments and webhooks in your Echo website
What is Stripe?
Payment processing made simple
Stripe handles payments, subscriptions, and webhooks. Echo uses Stripe for one-time payments for CLI access. Webhooks notify your application when payments are completed.
1
Create Stripe Account
Set up your Stripe account
- Go to stripe.com and create an account
- Complete business verification
- Get your API keys from Developers → API keys
2
Get API Keys
Copy your Stripe credentials
From Developers → API keys:
- Secret key →
STRIPE_SECRET_KEYKeep secret! - Publishable key →
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
# Add to .env.local:
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
3
Create Product and Price
Set up your CLI access product
- Go to Products → Create product
- Name: "Echo Boilerplate CLI Access"
- Set price: $99 (one-time payment)
- Copy the Price ID →
STRIPE_PRICE_ID
STRIPE_PRICE_ID=price_...
4
Set Up Webhook
Configure webhook endpoint for payment events
Your webhook endpoint:
Production: https://yourdomain.com/api/stripe/webhook
Local: http://localhost:3000/api/stripe/webhook
- Go to Developers → Webhooks
- Click Add endpoint
- Enter your webhook URL
- Select events to listen to:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updated
- Click Add endpoint
- Copy the Signing secret →
STRIPE_WEBHOOK_SECRET
Important:
The webhook secret starts with whsec_. Make sure to copy it completely and add it to your Vercel environment variables.
Testing Webhooks Locally
Use Stripe CLI for local development
Install Stripe CLI:
# Windows (using Scoop)
scoop install stripe
# Or download from:
https://stripe.com/docs/stripe-cli
Forward webhooks:
stripe listen --forward-to localhost:3000/api/stripe/webhook
This will give you a new webhook secret for local testing.
Complete Environment Variables
# Stripe Configuration
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_PRICE_ID=price_...
STRIPE_WEBHOOK_SECRET=whsec_...