Overview
Notion is a versatile productivity platform that consolidates note-taking, task management, and data organization tools into one interface. This document loader is able to take full Notion pages and databases and turn them into a LangChain Documents ready to be integrated into your projects.Setup
- You will first need to install the official Notion client and the notion-to-md package as peer dependencies:
npm
- Create a Notion integration and securely record the Internal Integration Secret (also known as
NOTION_INTEGRATION_TOKEN
). - Add a connection to your new integration on your page or database. To do this open your Notion page, go to the settings pips in the top right and scroll down to
Add connections
and select your new integration. - Get the
PAGE_ID
orDATABASE_ID
for the page or database you want to load.
The 32 char hex in the url path represents the ID
. For example:
PAGE_ID: https://www.notion.so/skarard/LangChain-Notion-API-b34ca03f219c4420a6046fc4bdfdf7b4
DATABASE_ID: https://www.notion.so/skarard/c393f19c3903440da0d34bf9c6c12ff2
?v=9c70a0f4e174498aa0f9021e0a9d52de
REGEX: /(?<!=)[0-9a-f]{32}/