Alpha Software — WarpKit is being built and used in production by Upstat to power their own application. While this real-world usage drives rapid improvements, the framework is still early stage. Use at your own risk. APIs and behaviors are subject to change.
A standalone Svelte 5 SPA framework providing state-based routing, data fetching, forms, and real-time capabilities.
- State-Based Routing - Routes organized by application state (unauthenticated, onboarding, authenticated)
- Navigation Pipeline - Every navigation flows through 10 predictable phases with guards and middleware
- Auth-Provider Agnostic - Bring your own auth adapter (Firebase, Auth0, custom)
- Config-Driven Data Layer - E-Tag caching, stale-while-revalidate, automatic refetching
- Schema-Driven Forms - Deep proxy binding with StandardSchema validation (TypeBox, Zod)
- Real-Time WebSockets - Type-safe messages, rooms, automatic reconnection
- Pluggable Provider System - Swap browser APIs for testing or custom implementations
- Generic Type System - Extend with your own user and data types
| Package | Description |
|---|---|
@upstat/warpkit |
Router, state machine, events, components |
@warpkit/data |
Data fetching, caching, mutations |
@warpkit/cache |
Cache implementations (Memory, Storage, E-Tag) |
@warpkit/forms |
Schema-driven form state management |
@warpkit/validation |
StandardSchema validation (Zod, TypeBox) |
@warpkit/websocket |
WebSocket client with reconnection |
@warpkit/auth-firebase |
Firebase authentication adapter |
@warpkit/types |
Shared TypeScript types |
npm install @upstat/warpkit @warpkit/data @warpkit/cacheOptional packages:
npm install @warpkit/forms @warpkit/validation
npm install @warpkit/websocket
npm install @warpkit/auth-firebase firebaseimport { createRoute, createStateRoutes } from '@upstat/warpkit';
type AppState = 'authenticated' | 'unauthenticated';
export const routes = createStateRoutes<AppState>({
unauthenticated: {
routes: [
createRoute({
path: '/login',
component: () => import('./pages/Login.svelte'),
meta: { title: 'Login' }
})
],
default: '/login'
},
authenticated: {
routes: [
createRoute({
path: '/dashboard',
component: () => import('./pages/Dashboard.svelte'),
meta: { title: 'Dashboard' }
}),
createRoute({
path: '/settings',
component: () => import('./pages/Settings.svelte'),
meta: { title: 'Settings' }
})
],
default: '/dashboard'
}
});import { createWarpKit } from '@upstat/warpkit';
import { routes } from './routes';
export const warpkit = createWarpKit({
routes,
initialState: 'unauthenticated'
});<!-- App.svelte -->
<script lang="ts">
import { WarpKitProvider, RouterView } from '@upstat/warpkit';
import { warpkit } from './warpkit';
$effect(() => {
warpkit.start();
return () => warpkit.destroy();
});
</script>
<WarpKitProvider {warpkit}>
<RouterView />
</WarpKitProvider><script lang="ts">
import { Link, useWarpKit } from '@upstat/warpkit';
const warpkit = useWarpKit();
function handleLogin() {
warpkit.setState('authenticated');
}
</script>
<Link href="/settings">Settings</Link>
<button onclick={handleLogin}>Login</button>WarpKit is intentionally minimal. These concerns are left to consumers:
- Title Management - Update
document.titleyourself based on route meta - Focus Management - Handle accessibility announcements yourself
- Error Boundary UI - Provide your own error handling UI
- Svelte 5.0.0+
- Node.js 18+
The WarpKit Guide is a comprehensive walkthrough covering everything from first setup to advanced architecture:
- Introduction & Philosophy — What WarpKit is, why it exists, and the design principles behind it
- Quick Start — Get a WarpKit app running in 5 minutes
- State-Based Routing — The core innovation: routes organized by application state
- The Navigation Pipeline — How every navigation flows through 10 predictable phases
- The Provider System — Pluggable abstractions for browser APIs
- Data Fetching & Caching — Config-driven data layer with E-Tag caching
- Forms & Validation — Schema-driven forms with deep proxy binding
- WebSockets & Real-Time — Type-safe real-time communication
- Authentication — Pluggable auth adapter pattern
- Testing — Mock providers, assertion helpers, and testing strategies
- Architecture & Design Decisions — Why WarpKit is built the way it is
The API docs cover package internals, components, providers, and testing utilities.