elpassion / notion-backup-link

Simple command to create link to download backup of a Notion workspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notion-backup

This is a very simple tool to export a workspace from Notion, designed to work as part of a GitHub workflow.

It reads NOTION_TOKEN and NOTION_SPACE_ID from the environment, and outputs the link to download zip file with html or markdown.

NOTE: if you log out of your account, the NOTION_TOKEN will get invalidated and this process will fail. There isn't anything that I know of that I can do about that until Notion decide to add a backup endpoint to their official API, at which point this will be able to use a proper authentication token.

Prerequisites

  • nodejs

Setup

  1. Get the NOTION_TOKEN and NOTION_SPACE_ID as explained in this blog post.
  2. In project root create .env.local file from .env file and fill in it (for aws see Run locally section).

Usage

$ node notion-backup.js

Parameters

-f --format <format>, html or markdown, default html
-d --debug, print debug messages

Run locally

# Login to aws with awsume
$ awsume [your-role]

# Print and copy credentials to .env.local file
$ env | grep AWS

# Build and run containers
$ npm run docker

About

Simple command to create link to download backup of a Notion workspace

License:MIT License


Languages

Language:JavaScript 50.5%Language:Shell 30.7%Language:TypeScript 15.6%Language:Dockerfile 3.2%