Installation
This guide covers installing jre-notion-workers and setting up credentials for local development.Prerequisites
Before installing, ensure you have the required runtime versions:- Node.js ≥ 22 (required for deployment)
- Bun ≥ 1.1 (recommended for local development, optional)
- ntn CLI for deployment (makenotion/workers-template)
Why Node 22? The
ntn workers deploy command targets Node.js 22 in production. Bun is used locally for faster dev iteration but all code must be Node-compatible.Install Dependencies
Choose your preferred package manager:@notionhq/client^2.2.15 - Official Notion SDK@notionhq/workers>=0.0.0 - Notion Workers platform (alpha)date-fns^3.6.0 - Date manipulation utilities
Configure Credentials
jre-notion-workers requires four environment variables to connect to your Notion workspace and databases.Required Environment Variables
| Variable | Purpose |
|---|---|
NOTION_TOKEN | Notion integration token |
DOCS_DATABASE_ID | Docs database ID (32-char hex, no dashes) |
HOME_DOCS_DATABASE_ID | Home Docs database ID |
TASKS_DATABASE_ID | Tasks database ID (for handoff tasks) |
For integration tests, also set
TEST_NOTION_TOKEN and TEST_DOCS_DATABASE_ID. Always use a dedicated test database, never production.Option A: Manual Setup
Copy the example environment file and fill in your credentials:Option B: 1Password (Maintainers)
If you’re a maintainer with access to the “Notion Workers” 1Password item:.env from the 1Password vault.
Option C: 1Password CLI (op run)
For terminal use without persistent .env files, use secret references in .env.1p:
Option D: 1Password + Cursor Hooks
This option is for Cursor IDE users who want secrets mounted on-demand without plaintext files on disk.
Create a 1Password Environment
In 1Password, create an Environment (e.g., “Notion Workers”) and add a Mount .env file destination pointing to this project’s
.env.local (or .env).Add these secrets to the Environment:NOTION_TOKENDOCS_DATABASE_IDHOME_DOCS_DATABASE_IDTASKS_DATABASE_ID
Enable the mount
In the 1Password app: Destinations → your local .env file → Enabled.Restart Cursor.
.cursor/hooks.json- Hook configuration.cursor/hooks/1password/validate-mounted-env-files.sh- Validation script.1password/environments.toml- Paths to validate
Using .env.local
If you keep credentials in .env.local (e.g., exported from 1Password), that file is also gitignored. Run with:
.env.local instead of .env. For one-off scripts or tests:
Deployment Credentials
For deployed workers, set secrets via the ntn CLI:process.env at runtime.
Verify Installation
Test your connection to Notion:Next Steps
Quickstart
Register your first worker and learn how to call the three tools