Skip to main content
Set up NotCMS in your project and start fetching content from Notion in minutes.

Prerequisites

Before you begin, make sure you have:
  • Node.js 18.17 or higher installed
  • A Notion account with at least one database
  • Basic knowledge of TypeScript (recommended)

Step 1: Install NotCMS

Step 2: Initialize Your Project

Use the NotCMS CLI to set up your project:
This command will:
  1. Create a notcms.config.json configuration file
  2. Open browser login when credentials are missing and save them to .env.local
  3. Pull a type-safe schema to src/notcms/schema.ts
  4. Print a first query example
Run the standalone pull command later whenever your Notion database schema changes:
The generated schema looks like this:

Step 3: Start Using NotCMS

Import the generated client and start querying your content:

What’s Next?

Configuration

Learn about advanced configuration options

SDK Reference

Explore the complete SDK API

Error Handling

Learn how to handle errors properly

Next.js Example

See a complete Next.js integration

Common Issues

Make sure your .env file is in the project root and you’re using a package like dotenv or dotenvx to load them.
Ensure your Notion databases have the correct permissions and your API key has access to them.
Run npx notcms pull again to regenerate the schema if you’ve made changes to your Notion databases.
Legacy CLI/SDK migration · Blog/release-note recipes Check schemas in CI Astro