/Azure-Function-Notion-To-Sanity

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

Primary LanguageTypeScript

Deploy - Github Workflow

Notion to Sanity Serverless Integration

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.

Running Locally

  1. Clone the repo
  2. Run npm install
  3. 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>
  1. Make sure you have azure blob service running. I use Azure Storage Emulator
  2. Run npm start to start the local server
  3. 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 select Execute Function Now...