Skip to main content

Basic Setup

To start using NotCMS, you need to initialize a client with your schema and credentials:

Prerequisites

Before initializing the client, ensure you have:
  1. Generated schema - Run npx notcms-kit init to generate for the first time or npx notcms-kit pull to update your schema
  2. Environment variables - Set up your API credentials
  3. Installed NotCMS - Add notcms to your project dependencies

Environment Variables

Required Variables

Loading Environment Variables

Framework-Specific Setup

Next.js App Router

Remix

SvelteKit

Troubleshooting

Common Issues

  • Check .env file exists in project root
  • Ensure you’re using a loader like dotenv
  • Verify variable names match exactly
  • Verify NOTCMS_SECRET_KEY is correct
  • Check NOTCMS_WORKSPACE_ID matches your workspace
  • Ensure API key has necessary permissions
  • Run npx notcms-kit pull to generate schema
  • Check import path is correct
  • Ensure schema file exports correctly
  • Update to latest NotCMS version
  • Regenerate schema with npx notcms-kit pull
  • Check TypeScript version compatibility

Next Steps

Once your client is initialized, you can:

List Items

Query multiple items from your databases

Get Single Item

Fetch individual items by ID