| name | notion-install-auth |
| description | Install and configure the Notion API SDK with authentication.
Use when setting up a new Notion integration, configuring API tokens,
or initializing @notionhq/client in your project.
Trigger with phrases like "install notion", "setup notion",
"notion auth", "configure notion API", "notion integration setup".
|
| allowed-tools | Read, Edit, Bash(npm:*), Bash(pip:*) |
| version | 1.38.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","productivity","notion","authentication","sdk","setup"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Notion Install & Auth
Overview
Set up the official Notion SDK and configure authentication for internal integrations. The Node.js SDK is @notionhq/client (npm) and the Python SDK is notion-client (pip) — both wrap the Notion API at https://api.notion.com/v1 using API version 2022-06-28.
Prerequisites
- Node.js 18+ or Python 3.8+
- Package manager (npm, pnpm, yarn, or pip)
- A Notion account (free or paid)
- Access to My Integrations dashboard
Instructions
Step 1: Create Integration and Install SDK
Create an internal integration at https://www.notion.so/my-integrations:
- Click New integration
- Name it, select the workspace, and choose capabilities (Read content, Update content, Insert content)
- Copy the Internal Integration Secret (starts with
ntn_ or secret_)
Install the SDK:
npm install @notionhq/client
pip install notion-client
Step 2: Configure Authentication
Store the token in environment variables -- never hardcode it:
export NOTION_TOKEN="ntn_your_integration_secret_here"
echo 'NOTION_TOKEN=ntn_your_integration_secret_here' >> .env
Share pages with your integration: In Notion, open the page or database you want to access. Click the ... menu, select Connections, and add your integration. Without this step, all API calls return object_not_found.
Step 3: Verify Connection
import { Client } from '@notionhq/client';
notion = ({ : process.. });
me = notion..({});
.();
.();