Introduction
Sp00ky is a reactive, local-first framework for SurrealDB. Write a query once and it stays correct, live, offline, and typed end to end.
That component is live, typed, and works offline. There is no fetch call, no cache invalidation, no WebSocket setup, no loading-state machine, and no hand-written types. You didn’t opt into any of it.
Three things to know
Your schema is the source of truth
Write plain SurrealQL. spky generate turns it into typed clients, and the same file drives sync
rules and row-level permissions.
No drift, no duplicated model definitions, no guessing what shape a row is.
Queries are maintained, not refetched
A sidecar keeps each registered query’s result up to date incrementally and tells clients only what changed. When data moves, whether from another user, another device, another tab, or a background job, your UI re-renders.
Backend calls go through the database
db.run() writes a row instead of making an HTTP request. The server picks it up and calls your
service. That one change makes server work offline-safe, retryable, and visible in the UI as an
ordinary live query.