Sync content between Hiveku and your Notion workspace
Many teams draft blog posts, case studies, and internal docs in Notion — it’s great for collaborative writing, but it’s not a public website. This integration lets you write in Notion and auto-publish to your Hiveku site, so you never have to copy-paste content again.
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).
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).
3
Copy the Internal Integration Token
Token looks like secret_abc123.... Treat it like a password — don’t commit it to git.
4
Share your database with the integration
Open the Notion database you want Hiveku to read. Click the … menu at the top right, go to Connections, and add Hiveku Publisher.
This step is easy to forget and is the most common cause of 404 errors later. The integration can only see databases that have been explicitly shared with it.
GET https://api.notion.com/v1/blocks/{{page.id}}/children
5
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).
6
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.
7
Mark the Notion page as Live
Update the page’s Status property to Live so it doesn’t re-publish on the next run:
Notion image URLs expire after 1 hour. If you link directly, your blog images will break the next day.
1
Download each image
When converting blocks, detect image blocks and fetch the image binary before the URL expires.
2
Re-upload to your assets storage
Push to your Hiveku media bucket, Cloudinary, S3, or wherever you host site assets.
3
Replace the URL in your Markdown
Use the permanent URL in your published post, not the Notion-hosted one.
Notion’s API has strict rate limits (3 requests/sec average). Batch where possible, and add a small delay (350ms) between requests in high-volume workflows. Hitting the limit returns 429 Too Many Requests.
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
Either the NOTION_API_KEY env var is wrong, or the integration has been revoked. Go to notion.so/my-integrations, check the integration exists, and regenerate the secret if needed.
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
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
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.