This works in both directions. You can pull from Notion into Hiveku (publish a blog), or push from Hiveku into Notion (log form submissions as database rows).
Step 1: Create a Notion Integration
Go to Notion integrations
Open notion.so/my-integrations and click New integration.
Name and configure it
- Name:
Hiveku Publisher(or whatever makes sense) - Associated workspace: the workspace with the content you want to sync
- Capabilities: at minimum check Read content. Add Update content if you also want to write back to Notion (e.g., mark a page as “Live” after publishing).
Copy the Internal Integration Token
Token looks like
secret_abc123.... Treat it like a password — don’t commit it to git.Step 2: Find Your Database ID
Open the Notion database as a full page (not embedded). The URL looks like:? is your database ID. Copy it.
Step 3: Store Credentials in Hiveku
Add two variables
NOTION_API_KEY— the integration token from Step 1NOTION_DATABASE_ID— the database ID from Step 2
Step 4: Build the Auto-Publish Workflow
This workflow polls Notion hourly and publishes any page markedStatus = Published.
Convert blocks to Markdown
Notion blocks are a JSON tree. Convert to Markdown using a library like
notion-to-md, or write inline transformation for simple cases (headings, paragraphs, lists, code).Create or update the blog post
Insert into your
blog_posts table (or whatever your schema uses), keyed by the Notion page ID so re-publishes update rather than duplicate.Reverse Direction: Hiveku to Notion
Useful for logging: push form submissions, CRM updates, or workflow events into a Notion database as new rows.Handling Images
Notion image URLs expire after 1 hour. If you link directly, your blog images will break the next day.Download each image
When converting blocks, detect image blocks and fetch the image binary before the URL expires.
Re-upload to your assets storage
Push to your Hiveku media bucket, Cloudinary, S3, or wherever you host site assets.
Verify It Worked
Create a test page in Notion
Add a new row to your synced database with Status = Published. Give it a title, some paragraph content, and save.
Troubleshooting
404 on the database query
404 on the database query
The integration doesn’t have access to the database. Open the database in Notion, click … > Connections, and add
Hiveku Publisher. This is the single most common cause of 404s on the Notion API.401 Unauthorized
401 Unauthorized
Images are broken after a day
Images are broken after a day
You linked directly to Notion-hosted images instead of re-uploading. Fix the workflow to download and re-upload images to your own asset storage. See the “Handling Images” section above.
Rich text formatting is lost
Rich text formatting is lost
Notion’s block-to-HTML conversion is lossy out of the box. Use a mature library like
notion-to-md rather than rolling your own parser — it handles callouts, toggles, bookmarks, and nested lists correctly.Pages duplicating on every run
Pages duplicating on every run
You’re inserting rather than upserting. Use the Notion page ID as a unique key in your blog_posts table, and either UPDATE on conflict or skip if already present.
What’s Next?
Webhook Patterns
Handle inbound webhooks from Notion and other tools
Post a Blog
Other ways to publish content on your site