Installation
One install per framework, or compose the modular packages yourself.
Start with a single bundle package per framework. It pulls in the server adapter, UI, admin dashboard, local media store and SEO tooling — everything a typical project needs. SQLite persistence is included; media stays off until you pick a file store, and SEO is installed but renders nothing until your pages use it.
Prerequisites#
- Node.js 22.9.0 or later
- pnpm (
corepack enable)
One install per framework#
| Framework | Bundle | What it pulls in |
|---|---|---|
| Next.js | @krantho/next | @krantho/server-next, @krantho/ui-react, @krantho/admin, @krantho/media-local, @krantho/seo |
| SvelteKit | @krantho/sveltekit | @krantho/server-sveltekit, @krantho/ui-svelte, @krantho/admin, @krantho/media-local, @krantho/seo |
| Vite / Express / Node | @krantho/node | @krantho/server-node, @krantho/admin, @krantho/media-local, @krantho/seo |
A bundle has no code of its own — you import from the packages it pulls in. pnpm does not let your code import a transitive dependency by name, so also add every package your own files import: @krantho/config (for krantho.config.ts), @krantho/schema and zod (for collections), the framework adapter, and the UI package your pages use.
pnpm add @krantho/next @krantho/server-next @krantho/ui-react @krantho/config @krantho/schema zod# @krantho/core provides renderContent for load functions
pnpm add @krantho/sveltekit @krantho/server-sveltekit @krantho/core @krantho/config @krantho/schema zod# plus your UI choice
pnpm add @krantho/node @krantho/server-node @krantho/ui-react @krantho/config @krantho/schema zod# @krantho/core provides renderContent for load functions
pnpm add @krantho/sveltekit @krantho/server-sveltekit @krantho/core @krantho/config @krantho/schema zod# plus your UI choice
pnpm add @krantho/node @krantho/server-node @krantho/ui-react @krantho/config @krantho/schema zod# plus your UI choice
pnpm add @krantho/node @krantho/server-node @krantho/ui-react @krantho/config @krantho/schema zod@krantho/node does not bundle a UI library on purpose — pick one yourself: @krantho/ui-react, @krantho/ui-svelte, @krantho/ui-mui or @krantho/ui-tailwind.
Scaffold a project#
npx create-krantho my-siteThe scaffolder asks for the framework (Next.js or SvelteKit), a UI library (Tailwind CSS, MUI on Next.js only, or plain CSS), token authentication, SEO components and sample content. It writes krantho.config.ts, krantho.collections.ts, the API route, the pages and the content directory, installs the dependencies, and initializes a git repository. The generated configuration turns on local media (media: { provider: 'local' }); a Next.js project also caches each page until a content change (cache: { pages: 'next-isr' }) and shows a banner while an editor previews drafts.
Configure#
Configuration is data in krantho.config.ts, resolved once at startup: defaults, then the file, then the environment. Every leaf except the structured ones (such as seo.collections, set in code only) can be overridden by an environment variable, and secrets (API keys, the JWT secret, database URLs) belong in the environment only. See the configuration reference for every section and variable.
Postgres#
The default persistence is SQLite — a single file, no database server to manage. For Postgres (horizontal scaling, managed databases such as Neon or Supabase), add the adapter and driver alongside the bundle:
pnpm add @krantho/persistence-postgres postgresThen select it from the environment:
KRANTHO_PERSISTENCE_PROVIDER=postgres
KRANTHO_PERSISTENCE_POSTGRES_URL=postgres://user:password@host:5432/dbMedia#
The bundles include @krantho/media-local, which stores uploads on local disk. Media turns on when krantho.config.ts sets media.provider; to store files in Vercel Blob, an S3-compatible bucket or Google Cloud Storage instead, install that store's package — see the media guide.
Modular installs#
The bundles exist for a quick start. Krantho is modular — install only what your stack needs and swap any piece. The core is always the same; you choose your persistence adapter and optional features. The commands below use the Next.js adapter; see Pick your framework adapter for the others.
Choose your mode#
| Mode | Adapter | Suits | Database needed? |
|---|---|---|---|
| Dev | persistence-fs | Prototyping, static sites | No |
| SQLite | persistence-sqlite | Most projects, local development and deploy | No (file-based) |
| Postgres | persistence-postgres | Production, horizontal scaling | Yes |
Dev mode (filesystem only)#
Content lives in .md files. No database, no version history, no media library. Select it with persistence: { provider: 'filesystem' } in krantho.config.ts (or KRANTHO_PERSISTENCE_PROVIDER=filesystem).
pnpm add @krantho/core @krantho/config @krantho/schema @krantho/persistence-fs @krantho/server-next @krantho/ui-react zodSQLite mode#
The full CMS with the admin dashboard, media library, versioning, content locking and SEO tools. SQLite is a single file — no database server to manage.
pnpm add @krantho/core @krantho/config @krantho/schema @krantho/persistence-sqlite @krantho/server-next @krantho/ui-react @krantho/admin @krantho/media-local zodMedia turns on when krantho.config.ts sets media: { provider: 'local' }; @krantho/media-local stores the uploads on disk. On a serverless host, pick a remote store instead — see the media guide.
Postgres mode#
The same features as SQLite, webhook delivery logging included. Use this when you need horizontal scaling, a managed database (Neon, Supabase) or existing Postgres infrastructure. Set KRANTHO_PERSISTENCE_PROVIDER=postgres and KRANTHO_PERSISTENCE_POSTGRES_URL.
pnpm add @krantho/core @krantho/config @krantho/schema @krantho/persistence-postgres @krantho/server-next @krantho/ui-react @krantho/admin @krantho/media-local zod postgresOptional packages#
| Package | What it adds |
|---|---|
@krantho/seo | Schema.org archetypes, JSON-LD, rich result validation |
@krantho/seo-shared | SEO field discovery primitives (installed with @krantho/seo) |
@krantho/ai | Zero-dependency LLM client (installed with the server; add it to call it from your own code) |
@krantho/media-local | Media file store on local disk (media.provider: 'local') |
@krantho/media-vercel-blob | Media file store on Vercel Blob |
@krantho/media-s3 | Media file store on S3-compatible storage (AWS S3, Cloudflare R2, MinIO) |
@krantho/media-gcs | Media file store on Google Cloud Storage |
Pick your framework adapter#
Replace @krantho/server-next with your framework adapter:
| Framework | Package |
|---|---|
| Next.js App Router | @krantho/server-next |
| SvelteKit | @krantho/server-sveltekit |
| Vite / Express / Node | @krantho/server-node |
Questions and answers
Does krantho work with my framework?
Krantho has adapters for Next.js (the App Router), SvelteKit, and Express, with a Vite plugin for development. For rendering, @krantho/ui-react, @krantho/ui-svelte, @krantho/ui-mui and @krantho/ui-tailwind are alternatives; rendered HTML carries semantic class names, so plain CSS works too.
The admin is the same React application on every framework, so a SvelteKit site ships it without React in its own pages. Other frameworks, such as Astro or Nuxt, have no adapter. The Node handler takes a Web Request and returns a Response, so it can be wired into other servers by hand.