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:- Create a
notcms.config.jsonconfiguration file - Open browser login when credentials are missing and save them to
.env.local - Pull a type-safe schema to
src/notcms/schema.ts - Print a first query example
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
Environment variables not loading
Environment variables not loading
Make sure your
.env file is in the project root and you’re using a package like dotenv or dotenvx to load them.Schema generation fails
Schema generation fails
Ensure your Notion databases have the correct permissions and your API key has access to them.
TypeScript errors
TypeScript errors
Run
npx notcms pull again to regenerate the schema if you’ve made changes to your Notion databases.