Notion as your app's database
Let an app you build keep its data in a Notion database. Connect once, choose a database, and the app reads and writes rows.
Notion works as a simple database for an app with a server. Your data stays in your own Notion workspace, and you can look at it and edit it in Notion any time. It is available on every plan.
Connect Notion#
Open Integrations → Notion and press Connect. Sign in with Notion and choose which pages or databases to share. If Connect Notion is not offered, use Use a token instead: create an internal integration at notion.so/profile/integrations, paste its secret, then open each database you want to use, choose ••• → Connections and add that integration.
Choose a database for a project#
- Open a project that has a server (Node, Python, Next.js and so on) and press + → Notion.
- Search your databases and press Use this, or paste a link to a database.
- Site Haus shows the database's columns and gives the app two managed settings:
NOTION_DB_URLandNOTION_DB_TOKEN. - Restart the app to pick them up. A published app also needs its internet switch on (Domains tab), because it calls Site Haus over the internet.
You can also just tell the AI: Save each lesson to my Notion database. It knows the columns and how to call it.
How the app uses it#
Every call sends Authorization: Bearer <NOTION_DB_TOKEN> and works with plain values keyed by column name:
| What | Call |
|---|---|
| Read the columns | GET {NOTION_DB_URL}/schema |
| List rows | GET {NOTION_DB_URL}/rows?limit=25&where.Done=false&sort=Name:asc |
| Add a row | POST {NOTION_DB_URL}/rows with { "values": { "Name": "Pasta", "Done": true } } |
| Change a row | PATCH {NOTION_DB_URL}/rows/ID with { "values": { "Done": false } } |
| Delete a row | DELETE {NOTION_DB_URL}/rows/ID (it is archived in Notion) |
Text, numbers, checkboxes, dates, selects, multi-selects, links, emails and phone numbers can be read and written. Formulas, rollups, relations and similar columns can be read only. The app can only reach the one database you chose, never anything else in your workspace, and your Notion login never reaches the app.
Limits#
- Who connects. The person who builds the app connects their own Notion, and the app uses that one workspace. Letting each visitor of your app connect their own Notion is not part of this feature.
- Servers only. The project needs a server. Browser-only sites cannot link a database.
- Internet switch. A published app must have its internet switch on (Domains tab) to reach the Notion address.
- One database per project, chosen from the databases shared with the connection.
- Speed. About three requests a second, queued and retried for you; reads are kept for a few seconds. Not for busy sites or complex queries.
- Column types. Text, numbers, checkboxes, dates, selects, multi-selects, links, emails and phone numbers can be read and written. Formulas, rollups and relations are read-only; files are not supported.
- Filtering is by exact match on one or more columns, and sorting is by up to three columns.
- Availability. If Notion is down, or the connection is removed, the app's data calls fail with a clear error until it is back or reconnected.
Good to know#
- Speed. Notion allows about three requests a second, so Site Haus queues and retries for you and keeps reads for a few seconds. It suits dashboards, trackers, planners, small CRMs and task lists. It is not the right place for busy sites, complex queries, or files (use File storage for those).
- Reconnecting. If you disconnect Notion or remove the database's connection in Notion, the app gets a clear "reconnect Notion" error instead of data.
- Changing columns. After you change the database in Notion, press Refresh columns.
- Unlinking removes the two settings and the app's access straight away. Your Notion data is untouched.
- Browser-only sites cannot use it, because they have no server to keep the key safe.