Environment variables must be set to configure your billing system.
.env
# Payment [Required] set the default payment provider for the checkout page. Must be one of `stripe` or `polar`NEXT_PUBLIC_DEFAULT_PAYMENT_PROVIDER=# [Required] priceId for stripe, productId for polar. If you don't want to use some of them, leave them empty.NEXT_PUBLIC_PREMIUM_PAYMENT_PRICE_ID=NEXT_PUBLIC_PREMIUM_PLUS_PAYMENT_PRICE_ID=NEXT_PUBLIC_SEO_ARTICLE_PRICE_PAYMENT_PRICE_ID=## Stripe [only required if you want to use Stripe Checkout]#STRIPE_SECRET_KEY=sk_test_...#STRIPE_WEBHOOK_SECRET=whsec_...## Polar [only required if you want to use Polar Checkout]#POLAR_ACCESS_TOKEN=## "sandbox" or "production"#POLAR_ENV=#POLAR_WEBHOOK_SECRET=
Next, we will introduce the integration with the payment provider.
After you have created your account for Stripe, you will need to get the API key. You can do this by going to the API page in the dashboard. Here you will find the Secret key and the Publishable key. You will need the Secret key for the integration to work.
After you have created your account for Polar, you will need to get the API key. You can do this by going to the API page in the dashboard. Under the Settings, scroll to Developers and click New token. Enter a name for the token, set the expiration duration and select the scopes you want the token to have. To keep it simple, you can select all scopes.