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.
| 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/cache
Optional packages:
npm install @warpkit/forms @warpkit/validation
npm install @warpkit/websocket
npm install @warpkit/auth-firebase firebase
import { 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:
document.title yourself based on route metaThe WarpKit Guide is a comprehensive walkthrough covering everything from first setup to advanced architecture:
The API docs cover package internals, components, providers, and testing utilities.