notion-security-basics
Installation
SKILL.md
Notion Security Basics
Overview
Security fundamentals for the Notion API: integration token management, internal vs public integration models, principle of least privilege for capabilities, page-level access auditing, token rotation, OAuth2 flows for public integrations, and webhook verification. All examples use @notionhq/client v2.x and target the 2022-06-28 API version.
Prerequisites
- Notion integration created at notion.so/my-integrations
- Node.js 18+ with
@notionhq/clientinstalled (npm install @notionhq/client) - Understanding of environment variables and
.envfile patterns - For public integrations: OAuth2 client ID and secret from the integration dashboard
Instructions
Step 1: Secure Token Storage and .env Management
Integration tokens are secrets with the same sensitivity as database passwords. Notion tokens use the ntn_ prefix (current) or secret_ prefix (legacy). Both grant full access to every page shared with the integration.