Using this to setup a database workflow in Notion to automatically publish blog content out to my Sanity Blog, because I hate writing in the Sanity editor.
- Clone the repo
- Run
npm install
- Create a
.env
file in the root of the project and add the following variables:
NOTION_API_KEY=<your-notion-api-key>
NOTION_DATABASE_ID=<your-notion-database-id>
SANITY_PROJECT_ID=<your-sanity-project-id>
SANITY_DATASET=<your-sanity-dataset>
- Make sure you have azure blob service running. I use Azure Storage Emulator
- Run
npm start
to start the local server - Then you can manually trigger the function by hitting
http://localhost:7071/api/NotionToSanity
or use your Azure extension, find your function, right click and selectExecute Function Now...