DEV Community

Alejandro Foronda
Alejandro Foronda

Posted on

Starter Template #2 | Next JS + Stripe Checkout

This template is a starter for those looking to use Next JS whit Stripe Checkout in a project.

DEMO

You can check a live sample in CodeSandbox. To test the complete flow you need to open the browser in a new tab.

NOW

You can deploy the project to Zeit's NOW directly from codesandbox or by cloning this repo.

Setup

localhost

Create an .env file with STRIPE_SECRET and STRIPE_CLIENT as well as a .env.build file with STRIPE_CLIENT and any other variable that Next needs at build time.

CodeSandbox

Add CodeSandbox secrets for STRIPE_SECRET and STRIPE_CLIENT.

NOW

Keep the now.json file and add the environment variables with the NOW CLI now secrets add <secret-name> <secret-value>.

Top comments (0)