When using preview deployments for testing billing flows, Stripe pricing rules need to be automatically seeded or the billing UI will fail with missing price errors.
Preview environments spin up fresh databases, but Stripe pricing objects aren't automatically created. When a user hits the billing page, the application can't find the expected price IDs.
Run migration command automatically when preview deploys:
# Example: GitHub Actions or CI pipeline
- name: Seed Stripe pricing
run: |
if [ "$ENVIRONMENT" = "preview" ]; then
npm run stripe:seed-prices
fi
env:
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}For one-off testing:
# Seed prices manually
npm run stripe:seed-prices -- --env=previewUse Stripe's test mode with fixed price IDs that are pre-created in your test account.
Preview environments need the same external service setup as production. Document or automate the seeding process - don't leave it as a manual step that gets forgotten.
Created 2026-04-11T07:23:17+00:00 · Edit