Find and Copy Your Notion Database ID
In this guide, you’ll learn how to find your Notion database ID (also called the data source ID) and add it to your project’s .env.local file. This connects your local project to your Notion blog database.
Step 1: Open Your Notion Database
Open the Notion workspace where your blog database is located (the one you duplicated earlier).
Make sure you’re viewing it in Table View.
On the right side of the database toolbar, you’ll see a slider icon (=) - click that button.

Step 2: Open Manage Data Sources
A panel will open on the right side of your screen.
In that panel, click on the Manage data sources tab.

Step 3: Copy the Database ID
Inside the Manage data sources tab, you’ll see your current database listed.
On the right side of the database name, click the three-dot (•••) button.
From the dropdown menu, select Copy data source ID.
You’ll see a small message pop up saying something like:
“Your Notion database name ID copied.”
This means your Notion database token has been copied to your clipboard.

Step 4: Add It to Your .env.local File
Now go back to your project folder and open the .env.local file.
Add this new line (replace the example value with your actual database ID):
NOTION_DATA_SOURCE_ID=your_database_token_here
After pasting your ID, save the file by pressing:
- Ctrl + S (on Windows)
- Cmd + S (on Mac)
Step 5: Done
That’s it - you’ve successfully added your Notion database ID to the project.
Your site is now connected to your Notion CMS and ready to pull content.
Next Step
