A minimalist starter kit for building content-driven websites using Notion as a headless CMS. This project is built on Next.js 16, React 19, and Tailwind CSS v4.
To use Notion as a CMS, you need to create an integration and share your database with it.
- Go to the Notion Developers portal.
- Click + New integration.
- Select the Workspace where your database is located.
- Give your integration a name and click Submit.
- Under Secrets, click Show and copy your Internal Integration Token. This will be your
NOTION_API_KEY.
- Open your database in Notion as a full page.
- Click the ... (three dots) in the top-right corner.
- Scroll to Connect to and search for the name of the integration you just created.
- Click Confirm to give the integration access.
- With the database open in your browser, look at the URL.
- The ID is the string of characters after your workspace name and the slash, but before the question mark.
- Format:
notion.so/username/DATABASE_ID?v=... - Copy this string. This will be your
NOTION_DATABASE_ID.
git clone <your-repo-url>
cd next-with-notion
pnpm installCreate a .env.local file in the root directory:
NOTION_API_KEY=your_internal_integration_token
NOTION_DATABASE_ID=your_database_idStart the local server:
pnpm devpnpm dev: Starts the development server.pnpm build: Creates an optimized production build.pnpm fix: Executes both linting and formatting fixes.
This starter kit is optimized for deployment on Vercel. Ensure you add your NOTION_API_KEY and NOTION_DATABASE_ID to the Environment Variables section in your project settings.