Warning
This repository has been archived as of January 11, 2024 and will not be further maintained. If you are curious about this repo and looking for help, please join our Discord https://clerk.com/discord
This is a demo implementation of use-stripe-subscription
To test it locally, .env.local must be populated with Stripe and Clerk environment variables according to the template in .env.local.example.
In addition to subscription management, this repository incorporates feature-gating via Stripe metadata.
In React, feature gating works via: <Gate feature="feature1">
In an API route, feature gating works via: customerHasFeature({customerId, "feature2"})
Both gates will deny the user unless you configure your Stripe Product's metadata with features set to feature1,feature2. Feature gating works with arbitrary strings.