Getting Started

Introduction

Tenon is a CMS that runs inside your app. The admin, the API and your content (pages, posts, media, etc.) share one repository, one deploy and one database.
Tenon is still considered pre-beta and pre-production at version 0.x. Most things work well, but minor versions can still contain breaking changes. Read the release notes before you upgrade. tenon upgrade links to them.

What is Tenon?

Tenon is a CMS-as-a-package you add to your app. It is made for Vite-based apps and works best there, but any server that speaks Request and Response can run it. It adds the admin and an HTTP API as routes of your app. Your server code reads content with a direct function call, without HTTP. You can extend it with your own fields, pages and plugins, or run it standalone as a headless CMS.

Web standards

The API is built on Hono and uses Request and Response. The same code runs on Node, Vercel and Cloudflare.

Local API first

Your server code calls cms.find() directly. No second service, no network hop, full types.

Lean

One package, one deploy, one database. Tenon adds routes to your app instead of running beside it.

Extensible

Add your own field types, admin pages and plugins without forking the core.

Why Tenon?

Most headless CMSs run as a second service, and your site calls them over HTTP. That works, but for small and medium sites it is often more than you need. A hosted CMS locks you and your content to a vendor. A self-hosted one is another service to deploy, secure and keep in sync.

Tenon keeps the CMS in your app. You describe your content in TypeScript:

collections/posts.ts
import { defineCollection } from "tenoncms";

export const posts = defineCollection({
  titleField: "title",
  fields: {
    title: { type: "text", required: true },
    slug: { type: "slug", from: "title", unique: true },
    body: { type: "richtext" },
  },
});

The types flow into your pages. find() knows the fields of posts, so a typo in a field name fails the type check:

server.ts
import cms from "./tenon.config";

const posts = await cms.find("posts", { where: { slug: "hello-world" } });
console.log(posts[0]?.title);

Works with your framework

Astro

Nuxt

TanStack Start

Standalone

Other frameworks

Runs where your app runs

Tenon deploys with your app, wherever it runs:

  • Node: any server or container, with SQLite, Postgres or PGlite
  • Vercel: serverless functions with Turso or Postgres
  • Cloudflare: Workers with a Durable Object database and R2

Key features

Built with

Limits and status

  • Tenon needs a server runtime. The admin and the API are server routes, so a purely static host cannot run them. Pages can still be prerendered or you use Tenon as a standalone headless CMS.
  • Tenon is built for and with Vite. Nonetheless it should be possible to integrate it with other frameworks. With a Vite-based framework, the integration serves the admin, runs background jobs and loads your custom admin code. Without Vite, you route the API, mount the admin and run jobs yourself. Currently untested though.