Documentation
Everything you need to build with X
A fullstack framework for Bun. Static sites, server-rendered pages, API routes, and server functions, all in a single process.
Start here
Introduction
What x is, how the packages fit together, and a minimal page.
Get startedInstallation
Prerequisites, create command, templates, and manual setup.
Get startedGetting Started
Project structure, your first page, and running the dev server.
Get startedMigration Guide
Move an existing Next.js or TanStack app to X.
Get startedPackages
@thexjs/core
Rendering engine: routing, SSR/SSG, islands, server functions, data layer.
Get started@thexjs/auth
Plug-and-play auth: credentials and OAuth2 (GitHub), sessions, and CSRF.
Get started@thexjs/cli
The x command: dev, build, start, and deployment output.
Get started@thexjs/env
Type-safe environment variable validation with fail-fast errors.
Get started@thexjs/adapter-vercel
Zero-config Vercel Build Output API v3 adapter for serverless deployment.
Get startedGuides
Routing
File-based routing: static pages, dynamic segments, nested routes.
Get startedPages & Loaders
Static pages, server-rendered pages, and data loading.
Get startedLayouts
Nested layouts, dedicated layout directories, and root layouts.
Get startedAPI Routes
Build REST endpoints alongside your frontend pages.
Get startedServer Functions
Call server-side functions from the browser without REST.
Get startedIslands
Selective hydration: ship JS only for the interactive parts.
Get startedIncremental Static Regeneration
Static pages that revalidate on a timer or on demand.
Get startedClient Navigation & Images
SPA-style navigation on every <a> tag by default, plus the remote image proxy.
Get startedContent Collections
Markdown files with frontmatter that become routes.
Get startedMiddleware
Route-level middleware for auth, redirects, and validation.
Get startedData Layer
SQLite and PostgreSQL integration with migrations.
Get startedBuild & Deploy
Production builds, static export, and deployment.
Get startedConfiguration
x.config.ts reference: all options and defaults.
Get startedSecurity
Env isolation, CSRF protection, security headers, and rate limiting.
Get startedObservability
Structured logging, health probes, and APM error tracing.
Get started