chrisfield / nextjs-graphcms-stripe

Home Page:https://nextjs-graphcms-stripe.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ecommerce example using Nextjs GraphCms and Stripe

Getting Started

Obviously clone the repo and yarn install (or npm if you prefer).

Create a Stripe account and define some products with prices - notice the 'API ID' stored against each product price.

Create a https://graphcms.com/ account. Define products in the schema to match the query in services/graphcms/get-all-products.ts. Create the same products you added to Stripe setting the stripePriceId to the product/price-api-id copied from stripe eg "price_1H5UA8Gr1aMYF0A8n2xKu8wW".

Copy .env-example to .env.local and set the values for Stripe and GraphCms

yarn dev or npm run dev

Useful links

GraphQL + Next.js

Type-safe Payments with Next.js, TypeScript, and Stripe

About

https://nextjs-graphcms-stripe.vercel.app


Languages

Language:TypeScript 98.6%Language:JavaScript 1.4%