Docs
GitHub

GitHub

Notion to GitHub with notion-downloader.

How to set up a GitHub repository that uses notion-downloader to pull content from Notion.

Notion to GitHub with notion-downloader

This guide explains how to set up a GitHub repository that uses notion-downloader to pull content from Notion.

Steps

  1. Install notion-downloader:
npm install notion-downloader
  1. Get your NOTION_TOKEN and ROOT_ID from the Notion Setup guide.

  2. Create the downloader configuration:

    Run npx notion-downloader init and use these options in downloader.json created:

{
  ... 
  "rootObjectType": "page",
  "conversion": {
    ... 
    "pageLinkHasExtension": true,
    "markdownPrefixes": {
      "markdown": "",
      "assets": ""
    },
    "layoutStrategy": {
      "markdown": "hierarchical",
      "assets": "hierarchical"
    },
    "namingStrategy": {
      "markdown": "githubSlug",
      "assets": "default"
    }
 
    ...
  }
  ...
}

Name your root page README for it to be featured on the repository home page.

  1. Add your Notion token:

    a. In a .env file:

    NOTION_TOKEN=your_token_here

    b. Or use it directly with the CLI.

  2. Run the downloader:

npx notion-downloader pull