Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to seed stripe products and prices #319

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ChrisGambrell
Copy link

This change adds a script to seed products and prices from Stripe.

This change will benefits developers working in a shared development environment by allowing them to work with the same products and prices.

The script is ran with the following command: pnpm stripe:seed.

Copy link

vercel bot commented Mar 26, 2024

@ChrisGambrell is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

@olivernettinger
Copy link

olivernettinger commented Apr 5, 2024

Hi @ChrisGambrell that is a useful addon. How would you trigger script execution? I don't see an updated package.json to include the stripe:seed command, so this command is not found.

I tried with npx ts-node scripts/seed-stripe.ts, but this results in: Error: Cannot find module 'tsconfig-paths/register'. Then I pnpm install -D tsconfig-paths, which allowed ts-node to run, but I get error:
if (!supabaseUrl) throw new Error('supabaseUrl is required.') Error: supabaseUrl is required.

Update: so I guess I got it now with:
npx ts-node -r scripts/dotenv.config.ts scripts/seed-stripe.ts

@ChrisGambrell
Copy link
Author

Hi @ChrisGambrell that is a useful addon. How would you trigger script execution? I don't see an updated package.json to include the stripe:seed command, so this command is not found.

I tried with npx ts-node scripts/seed-stripe.ts, but this results in: Error: Cannot find module 'tsconfig-paths/register'. Then I pnpm install -D tsconfig-paths, which allowed ts-node to run, but I get error: if (!supabaseUrl) throw new Error('supabaseUrl is required.') Error: supabaseUrl is required.

Update: so I guess I got it now with: npx ts-node -r scripts/dotenv.config.ts scripts/seed-stripe.ts

Apologies- I forgot to include the command to run! This should be updated now. You can seed products and prices from stripe with the command pnpm stripe:seed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants