Prerequisites
Before you begin, make sure you have:- Node.js 12 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:- Check environment variables
- Create a
notcms.config.json
configuration file
Step 3: Configure Environment Variables
Add your NotCMS credentials to your.env
file:
Get your credentials from the NotCMS Dashboard
Step 4: Pull Your Schema
Generate TypeScript types from your Notion databases:src/notcms/schema.ts
:
Step 5: Start Using NotCMS
Create a 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-kit pull
again to regenerate the schema if you’ve made changes to your Notion databases.