Kiln Documentation#
Kiln is a file-based server-side rendering framework for React and Vite. You write a directory of React components or Markdown files. Kiln turns that directory into routes, decides how each route renders (on the server, in the browser, or both), and ships only the code each page needs.
This documentation covers every package in the Kiln monorepo, one page per package in the API reference, plus task-oriented guides that explain how the pieces fit together.
Packages#
| Package | Version | What it does |
|---|---|---|
@kiln-js/core | 0.2.0-hotfix | Route matching, the route scanner, env validation, titles, islands, deferred data, HTTP errors, and form validation. Runs on the server and in the browser. |
@kiln-js/server | 0.2.0-hotfix | Request handler. Renders pages to HTML, streams server pages, dispatches API routes, runs actions, and applies CSRF and CORS. |
@kiln-js/client | 0.2.0-hotfix | Browser runtime. Hydration, client-side navigation, prefetching, Link, and error boundaries. |
@kiln-js/vite-plugin | 0.2.0-hotfix | Vite integration. Builds the route table, compiles server code out of client bundles, rewrites <kiln:title>, and detects islands. |
@kiln-js/md | 0.2.0-hotfix | Vite plugin that turns .md files in the pages folder into routes, with every Markdown tag rendered by a component you control. |
@kiln-js/adapter-vercel | 0.2.0-hotfix | Produces Vercel's Build Output API files and runs the server as an Edge function. |
@kiln-js/cli | 0.2.0-hotfix | The kiln command: create, dev, build, start, routes, generate, typecheck, doctor, and test. |
@kiln-js/auth | 0.2.0-hotfix | Accounts, password sign-in, GitHub and Google sign-in, sessions, and authorization hooks. |
Start here#
- Installation: requirements and installing the CLI.
- Quick start: create an app, run it, and build it.
- Project structure: what each folder and special file does.
Guides#
- Routing: file-based routes, dynamic segments, route groups, and URL rules.
- Rendering modes:
universal,.server, and.clientpages and when to use each. - Loaders and actions: loading data for a page and handling form submissions.
- Forms and validation: reading request bodies and validating them with
v. - Layouts: nested layouts,
_layoutfiles, and how they wrap pages. - Titles and head:
<kiln:title>, Markdown titles, and the default title. - API routes: HTTP handlers under
app/api. - Markdown pages: writing pages in Markdown and styling their tags.
- Islands: hydrating a single component without hydrating the page.
- Streaming: sending the page shell first and deferred data later.
- Environment variables:
.envfiles and typed environment schemas. - Errors and not-found pages:
HttpError,notFound,redirect,_error, and_not-found. - Security: CSRF protection and CORS.
- Authentication: wiring
@kiln-js/authinto an app. - Deploying:
kiln build,kiln start, and Vercel.
API reference#
- @kiln-js/core
- @kiln-js/server
- @kiln-js/client
- @kiln-js/vite-plugin
- @kiln-js/md
- @kiln-js/adapter-vercel
- @kiln-js/cli
- @kiln-js/auth
Conventions used in these docs#
Code samples use TypeScript and TSX. File paths assume the default layout created by kiln create. Where a behavior depends on the runtime, the docs say so. Kiln runs on Bun and on Node 18 or later. Bun is recommended, and the CLI reports which runtime and bundler it is using when it starts.

