Developers

Quickstart

Ship your first content model in minutes. From an empty terminal to a live, typed API in three steps.

Step 1

Scaffold the client

Run the CLI from your project root. It writes a small cairn/lib client wrapper — and, if you want it, live-editing preview routes — into your existing app. No schema files, nothing to configure yet.

terminal
$ npm create cairn@latest
Is this a TypeScript project? (y/N) y
✓ Wrote cairn/lib/client.ts
Set up live preview? (y/N) y
✓ Wrote cairn/lib/preview.ts
Install @cairn-cms/client now? (y/N) y
✓ Done

Step 2

Model your first type in the Dashboard

Open dashboard.cairn.press, create a project, and build your first type on the canvas — drag on a field, draw a line to connect a relationship, done. Add the project's CAIRN_PROJECT_ID to .env.local and you're reading real content.

article5 fields
author4 fields

Step 3

Query it from your app

Import the client Step 1 wrote and start fetching content — reads from whichever project CAIRN_PROJECT_ID points at, published or draft.

app/page.tsx
import { client } from '@/cairn/lib/client'

const articles = await client.fetch('article')

Where to next

Once you're up and running

Generate types

Run `cairn typegen` to pull real TypeScript types from your schema, on demand.

Explore the CLI

Manage datasets, backups and webhooks without leaving your terminal.

Join Discord

Ask questions and see what other teams are building with Cairn.

You're ready to build

Everything from here on builds on the same three steps.