Learn how to build a website that uses Notion as a Content Management System (CMS) with Replit Agent.
Final result: A minimalistic blog powered by Notion
Create a Notion integration
Creating a new integration in Notion
Configuring your Notion integration
Obtaining your Integration Secret
Create a Notion page with a database
Title
(Text, default title property)Body
(Text, for main post content)Slug
(Text, for URL-friendly identifiers)PublishedDate
(Date, or use “Created time” / “Last edited time”)ReadingTime
(Text or Number, e.g., “5 min read”)Description
(Text, short summary for previews)Example Notion database setup for blog posts
Connect your integration to the page
Access the integration menu in Notion
Adding your integration to the Notion page
Open Replit Agent
Write your prompt
Scrape the content of [URL] for initial design inspiration and placeholder text.
Review the initial preview
Add Secrets in Replit
NOTION_API_KEY
: Your Internal Integration Secret from Step 1.NOTION_DATABASE_ID
: The ID of your Notion database.https://www.notion.so/your-workspace/PAGE_TITLE-PAGE_ID?v=DATABASE_VIEW_ID
. The PAGE_ID
is often the database ID if the database is the page’s main element.https://www.notion.so/your-workspace/DATABASE_ID?v=VIEW_ID
contains the DATABASE_ID
before ?v=
.NOTION_API_KEY
, Value: [Your_Notion_Integration_Secret]
NOTION_DATABASE_ID
, Value: [Your_Notion_Database_ID]
Adding your Notion secrets to Replit
Debugging your Notion app using the Replit Console
created_time
for sorting) that don’t exist or are named differently in your Notion database.
created_time
and you have PublishedDate
, it’s a mismatch.created_time
in Notion as a quick fix, you can later ask Agent: “Remove reliance on ‘created_time’, use ‘PublishedDate’ instead.” Remember to use Agent’s Checkpoints to save working states.notionService.js
usually handle Notion API calls.Implement caching and prefetching
Enhance styling
Configure data refresh strategy
Deploying your Notion-powered website
Experiment with content types
Leverage advanced Notion features
Combine with other Replit integrations