Manage Products via stripe-fixtures.json
mainProducts and prices are managed via stripe-fixtures.json. When you update this file and run the fixture command, the webhook at src/app/api/webhooks automatically synchronizes the changes to your Supabase database.
Adding Custom Metadata
You can store custom information in the metadata field of a product in the fixture. To use this data in a type-safe way:
- Add your field (e.g.,
team_invites) to the fixture metadata. - Update the Zod schema in
src/features/pricing/models/product-metadata.ts. - Parse the metadata in your application code.
const products = await getProducts();
const productMetadata = productMetadataSchema.parse(products[0].metadata); // Now it's typesafe 🙌!
productMetadata.teamInvites; // The value you set in the fixture