Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ GITHUB_CLIENT_ID=0v23li58m3t8TIbfIr8A
NEXT_PUBLIC_GITHUB_CLIENT_ID=Ov231iS8m3t8TIbfIr8A
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret

# Public URL of your app (used for OAuth callback redirect)
NEXT_PUBLIC_APP_URL=https://repo-app-architect.vercel.app
# Public URL of your app (used for OAuth + Stripe redirects). Use your custom domain in production.
NEXT_PUBLIC_APP_URL=https://repofuse.com

# Stripe (live mode for production)
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Signing secret from: Stripe Dashboard → Developers → Webhooks → your endpoint → Signing secret
# Endpoint URL must be: https://repofuse.com/api/stripe/webhook (lowercase host is fine)
STRIPE_PRO_PRICE_ID=price_...
STRIPE_SCALE_PRICE_ID=price_...

# OpenAI API Key (used by Vercel AI SDK for analysis)
OPENAI_API_KEY=sk-...
Expand Down
15 changes: 15 additions & 0 deletions VERCEL_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ Go to your Vercel project → **Settings** → **Environment Variables** and add
| `NEXT_PUBLIC_APP_URL` | Preview | Leave blank — Vercel sets this automatically for previews |
| `OPENAI_API_KEY` | Production, Preview | OpenAI API key for AI analysis |
| `ANTHROPIC_API_KEY` | Production, Preview | Anthropic API key for scaffold generation |
| `STRIPE_SECRET_KEY` | Production | Live secret key (`sk_live_...`) |
| `STRIPE_WEBHOOK_SECRET` | Production | Signing secret (`whsec_...`) from the **live** webhook endpoint |
| `STRIPE_PRO_PRICE_ID` | Production | Pro plan Price ID |
| `STRIPE_SCALE_PRICE_ID` | Production | Scale plan Price ID (optional) |

### Stripe webhooks (live mode)

1. [Stripe Dashboard → Developers → Webhooks](https://dashboard.stripe.com/webhooks) (ensure **Live** mode toggle is on).
2. Endpoint URL: `https://repofuse.com/api/stripe/webhook`
(`https://RepoFuse.com/...` works too; hostnames are case-insensitive.)
3. Subscribe to at least: `checkout.session.completed`, `customer.subscription.updated`, `customer.subscription.deleted`, `invoice.payment_succeeded`, `invoice.payment_failed`.
4. Copy **Signing secret** → Vercel env `STRIPE_WEBHOOK_SECRET` for **Production** only.
5. Redeploy after changing `STRIPE_WEBHOOK_SECRET`.

**If Stripe emails about failed deliveries:** open the webhook → **Event deliveries** and check the HTTP status. `400 Invalid signature` means `STRIPE_WEBHOOK_SECRET` does not match that endpoint’s signing secret. `503 Webhook not configured` means the env var is missing on Vercel.

---

Expand Down
Loading
Loading