A Next.js App Router template project for integrating Creem with modern web apps. This template demonstrates how to use the Creem SDK to implement common subscription and payment flows. Use this as a starting point for your own Creem-powered SaaS or product.
Note: This is a template project. We welcome issues for new use cases and pull requests to improve the template!
-
Clone the repository
-
Install dependencies (use your preferred package manager)
yarn install # or npm install # or pnpm install
-
Set up your environment variables
cp .env.example .env # Edit .env and fill in the required variables
-
Run database migrations (creates a local SQLite database)
yarn prisma migrate dev
-
Start the development server
yarn dev
-
Expose your app to the internet for webhooks
To receive webhooks from Creem, you need a reverse proxy. We recommend NGROK, which is free and easy to set up.
This template provides a ready-to-use integration with Creem, Prisma, and Next.js App Router. It demonstrates:
- Fetching and displaying all products in your Creem account
- Creating checkout sessions for products
- Fulfilling orders based on the purchasing account
- Handling subscription creation, cancellation, and expiration
- Generating customer portal links for clients with active subscriptions
The codebase is modular, uses TypeScript throughout, and leverages modern React patterns with Shadcn UI, Radix UI, and Tailwind CSS. The template is not taking security into account, so please be careful when using any of its code in production.
- Next.js – React framework for server-side rendering and static site generation
- Prisma – Type-safe ORM for database access
- SQLite – Lightweight, file-based relational database
- Creem SDK – Subscription and payment integration
- Request new use cases: Create an issue
- Improve the template: Open a pull request
We welcome contributions and feedback from the community!
MIT