Krantho is in active development and not yet published to npm. Read what that means today.
esc

Search the documentation and product pages. Type “theme” to switch themes.

Installation

One install per framework, or compose the modular packages yourself.

BeginnerApplies toNext.jsSvelteKitExpress / Vite

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#

FrameworkBundleWhat 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-site

The 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 postgres

Then select it from the environment:

.env
KRANTHO_PERSISTENCE_PROVIDER=postgres
KRANTHO_PERSISTENCE_POSTGRES_URL=postgres://user:password@host:5432/db

Media#

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#

ModeAdapterSuitsDatabase needed?
Devpersistence-fsPrototyping, static sitesNo
SQLitepersistence-sqliteMost projects, local development and deployNo (file-based)
Postgrespersistence-postgresProduction, horizontal scalingYes

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 zod

SQLite 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 zod

Media 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 postgres

Optional packages#

PackageWhat it adds
@krantho/seoSchema.org archetypes, JSON-LD, rich result validation
@krantho/seo-sharedSEO field discovery primitives (installed with @krantho/seo)
@krantho/aiZero-dependency LLM client (installed with the server; add it to call it from your own code)
@krantho/media-localMedia file store on local disk (media.provider: 'local')
@krantho/media-vercel-blobMedia file store on Vercel Blob
@krantho/media-s3Media file store on S3-compatible storage (AWS S3, Cloudflare R2, MinIO)
@krantho/media-gcsMedia file store on Google Cloud Storage

Pick your framework adapter#

Replace @krantho/server-next with your framework adapter:

FrameworkPackage
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.

Read the documentation

Next steps