A 5-minute walkthrough.
git clone https://github.com/a2z2k26/notion-github-sync.git
cd notion-github-sync
npm installOr as a dependency in your own project:
npm install notion-github-sync- Visit https://www.notion.so/my-integrations
- Click + New integration
- Name it (e.g. "Bumba")
- Select your workspace
- Click Submit, then copy the Internal Integration Token (starts with
secret_orntn_)
The integration cannot access any pages until you explicitly share them.
- Open or create a page in Notion (e.g. "Bumba Projects")
- Click Share in the top-right
- Search for your integration name and click Invite
- Copy the page ID from the URL — it's the 32-character hex string after the page slug
Full walkthrough with screenshots: notion-setup.md.
cp .env.example .envEdit .env:
NOTION_API_KEY=secret_…
NOTION_PARENT_PAGE_ID=…
npx notion-github-sync verifyExpected:
Connected as: <integration name>
Parent page is accessible
If you see Verification failed, the most common causes are:
- API key is wrong or revoked → regenerate it
- Page wasn't shared with the integration → re-share it
- Page ID is malformed → 32 hex chars (with or without dashes)
node examples/02-create-page.jsThis creates a page in your Notion workspace using a mix of block types — heading, paragraph, divider, bullet list, callout. Open the URL in the script's output to see the result.
node examples/03-create-database.jsThis creates a "My Tasks" database with the built-in TASKS schema, including columns for Status, Priority, Assignee, Due Date, GitHub Issue link, and Last Synced.
The script prints the database ID — add it to your .env as NOTION_TASKS_DATABASE_ID to enable GitHub sync.
Add a GitHub PAT (with repo scope) and a target repo to your .env:
GITHUB_TOKEN=<github-token>
GITHUB_REPO=owner/name
NOTION_TASKS_DATABASE_ID=…
Then:
node examples/04-github-sync.jsOr via the CLI:
npx notion-github-sync sync -r owner/name -d <database-id>This pulls all open and recently-closed issues from the repo into your Notion database, creating new pages or updating existing ones based on GitHub Number.
api.md— Full API reference../examples/— More worked examplesCONTRIBUTING.md— Contribute back