Skip to content
AddHunt
Notion integrations

NotionCMS

Use a Notion database as a headless CMS for websites

Works with ServerOpen source

  • Open source
  • Licence: MIT

In short

NotionCMS is an open-source JavaScript package that turns a Notion database into a headless CMS by building a cached, serialized content tree for websites. It is for developers who manage site content in Notion and build sites with static site generation.

What you get

  • Notion database as a headless CMS
  • Content as HTML, Markdown and plain text
  • Routing driven by database structure
  • Content caching for faster static builds
  • Custom block renderers and plugins
  • Tag, filter and path query utilities

The details

NotionCMS lets a Notion database serve as the content source for a website. It runs on the server, reads the database through the Notion API and builds a serialized data tree of routes, tags and pages that can be cached. Each page's content is then available as HTML, Markdown and plain text.

Core features

  • Framework agnostic, since it is plain JavaScript
  • A collection-based content tree built from the Notion database, with the database structure controlling routing
  • Geared towards static site generation, with content caching to speed up builds
  • Notion blocks transformed into Markdown, plain text and customizable HTML, with custom renderers for individual blocks
  • Tagging, filtering, path queries and utilities for walking the tree
  • A plugin system, with core plugins planned
  • Syntax highlighting built in through highlight.js

Why it exists

The authors note that Notion is good for managing content and has a solid API and SDK, but using it as a headless CMS in production takes work. NotionCMS handles that layer so content can be pulled with a few lines of code.

Getting started

The package is installed from npm as a development dependency with npm, pnpm or yarn. It is open source under the MIT license, funded through GitHub sponsorship, and its site includes a 1.0 roadmap, a quickstart and API docs next to the guide.

Alternatives to NotionCMS

Questions

Does NotionCMS run in the browser?

No. It runs on the server; the data is serialized there and sent to the client with the rest of the bundle.

Which frameworks does it work with?

It is framework agnostic, since it is plain JavaScript, and it is geared towards static site generation.

What formats does it output?

Each page's content is available as HTML, Markdown and plain text, and custom renderers can change how Notion blocks become HTML.

More like this