Skip to content

Repository files navigation

Notion Custom Domain

Publish a public Notion page through your own domain instead of notion.site.

Notion Custom Domain

Getting Started

Use Node.js 24, then install dependencies:

npm install

Link the repository to Vercel and configure your public Notion page:

npx vercel link
npx vercel env add PAGE_URL

Select Production when prompted for the target environment.

Set PAGE_URL to the public Notion page to publish, for example:

https://your-workspace.notion.site/Your-Page-ID

Then create the first Production deployment:

npm run deploy:prod

Finally, add a custom domain for the deployment in the Vercel project. See Custom Domains – Vercel Docs.

Configuration

Variable Required Purpose
PAGE_URL Yes Public Notion page URL, including its page ID
GA_MEASUREMENT_ID No Google Analytics measurement ID to inject

Register variables with npx vercel env add <VARIABLE_NAME>, choosing which environment(s) each one applies to: Production (npm run deploy:prod), Preview (npm run deploy), or Development (npm run vercel:dev).

npm run dev does not use Vercel environment variables; it reads .env directly (see Development).

Development

Command Purpose
npm run dev Runs the proxy locally against .env (copy from .env.example)
npm run vercel:dev Runs the proxy through Vercel's local runtime; run npx vercel pull first
npm run deploy Creates a Preview deployment
npm test Runs the unit tests
npm run check Runs linting, type checking, and unit tests
npm run fix Applies Biome's safe lint and formatting fixes

Monitoring

A scheduled GitHub Actions workflow (.github/workflows/monitor.yml) checks the deployed site every 6 hours and opens a GitHub issue on failure. Set the repository variable SITE_URL to the URL to monitor.

Run the same check locally:

SITE_URL=https://notion-custom-domain.hosso.co npm run monitor:smoke

See docs/monitoring.md for what it checks and how to investigate a failure.

License

MIT

About

Custom domains for your Notion pages

Topics

Resources

Stars

98 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages