Github|...

Framework guides

Every sp00ky client side by side: which package to install, the same live query in each, and what each one supports.

sp00ky has one sync engine and a client for each place your app runs. The TypeScript core (@spooky-sync/core) runs in the browser, and the Solid, Solid 2, React, Svelte and Angular bindings wrap it in each framework’s own reactivity. Flutter apps use the Dart client, and desktop apps, CLIs and services use the Rust client. They all talk to the same server with the same protocol, so a web app, a phone and a desktop app can share one database and see each other’s writes live.

Pick a client

ClientInstallRuns onGuide
SolidJS@spooky-sync/client-solidBrowser, Solid 1.xSolidJS guide
Solid 2 (RC)@spooky-sync/client-solid2Browser, Solid 2.0 RCSolid 2 guide
React@spooky-sync/client-reactBrowser, React 18 and 19React guide
Svelte@spooky-sync/client-svelteBrowser, Svelte 5.29+ (runes)Svelte guide
Angular@spooky-sync/client-angularBrowser, Angular 21+ (signals)Angular guide
Flutterspooky_core and spooky_flutter (Dart, from git)Flutter apps on iOS and AndroidFlutter guide
Rustspooky-core crate (from git)Desktop apps, CLIs and servicesRust guide
Vanilla JS / TS@spooky-sync/coreBrowser, with any framework or noneVanilla guide
React Native

The TypeScript clients run SurrealDB and SQLite as WebAssembly with IndexedDB or OPFS and web workers, which React Native does not have. For a mobile app, use the Flutter client.

The same live query in each

The latest 20 threads, newest first. Each version paints from the local store first, then stays live: a local write, another tab or another device updates it without a refetch.

SolidJS

import { For } from 'solid-js';
import { useDb, useQuery } from '@spooky-sync/client-solid';

const db = useDb<typeof schema>();
const threads = useQuery(() =>
  db.query('thread').orderBy('created_at', 'desc').limit(20).build()
);

<For each={threads.data() || []}>{(t) => <li>{t.title}</li>}</For>

Solid 2

import { For } from 'solid-js';
import { createQuery, useDb } from '@spooky-sync/client-solid2';

const db = useDb<typeof schema>();
const threads = createQuery(
  db.query('thread').orderBy('created_at', 'desc').limit(20).build()
);

<For each={threads.data()}>{(t) => <li>{t.title}</li>}</For>

React

import { useDb, useQuery } from '@spooky-sync/client-react';

const db = useDb<typeof schema>();
const threads = useQuery(
  db.query('thread').orderBy('created_at', 'desc').limit(20).build()
);

if (threads.isLoading) return <Spinner />;
return threads.data.map((t) => <li key={String(t.id)}>{t.title}</li>);

Svelte

<script lang="ts">
  import { useDb, useQuery } from '@spooky-sync/client-svelte';

  const db = useDb<typeof schema>();
  const threads = useQuery(() =>
    db.query('thread').orderBy('created_at', 'desc').limit(20).build()
  );
</script>

{#each threads.data as t (String(t.id))}<li>{t.title}</li>{/each}

Angular

@Component({
  selector: 'app-threads',
  template: '@for (t of threads.data(); track t.id) { <li>{{ t.title }}</li> }',
})
export class Threads {
  private readonly db = injectDb<typeof schema>();
  protected readonly threads = injectQuery(() =>
    this.db.query('thread').orderBy('created_at', 'desc').limit(20).build()
  );
}

Flutter

// db is the AppDb generated from your schema
final Stream<List<Thread>> threads = db.thread
    .query()
    .orderBy(Thread$.createdAt, desc: true)
    .limit(20)
    .watch();

StreamBuilder<List<Thread>>(
  stream: threads,
  builder: (context, snap) => ListView(
    children: [for (final t in snap.data ?? const <Thread>[]) Text(t.title)],
  ),
)

Rust

let mut threads = client
    .live(client.query("thread").order_by("created_at", "desc").limit(20))
    .await?;

println!("{} threads from the local store", threads.rows().len());

// Every change after: a local write, another device, the web app.
while let Ok(rows) = threads.changed().await {
    println!("{} threads", rows.len());
}

Vanilla JS / TS

import { client } from './db';

const { hash } = await client
  .query('thread', {})
  .orderBy('created_at', 'desc')
  .limit(20)
  .build()
  .run();

const unsubscribe = await client.subscribe(hash, renderThreads, { immediate: true });

How each one hands you data

ClientLive resultsWritesLoading state
SolidJSAccessors: threads.data()db.create / db.update / db.deleteisLoading()
Solid 2Accessors, plus ready() for <Loading> suspensionSame, plus createSubmission for button stateisLoading(), isEmpty(), isSettled()
ReactPlain values through useSyncExternalStore, rows keep their identity between updatesSame, plus useSubmission for button stateisLoading, isEmpty, isSettled
SvelteReactive getters on runes: threads.data, rows keep their identity between updatesSame, plus useSubmission for button stateisLoading, isEmpty, isSettled
AngularSignals: threads.data(), rows keep their identity between updatesSame, plus injectSubmission for button stateisLoading(), isEmpty(), isSettled()
FlutterStream<List<T>> from the generated AppDb, for a StreamBuildercreate / update / delete on the client or the typed tablesisQueryAuthoritative, isQuerySettled
RustLiveQuery: rows() now, changed().await for each updatecreate / update / delete, typed structs from build.rsis_authoritative() and status() on the live query
Vanillaclient.subscribe(hash, callback)client.create / update / deletesubscribeQueryAuthority, subscribeQueryStatus

Every client writes to the local store first and syncs in the background, so writes work offline and the UI updates before the server answers.

What each client supports

FeatureSolidSolid 2ReactSvelteAngularFlutterRustVanilla
Live queries, mutations, authYesYesYesYesYesYesYesYes
Offline and sync healthYesYesYesYesYesYesYesYes
File bucketsYes, with <BucketImage>Yes, with <BucketImage>Yes, with <BucketImage>Yes, with <BucketImage>Yes, with <sp00ky-bucket-image>Yes, with BucketImageYesYes
Feature flags and app releasesYesYesYesYesYesYesYesYes
CRDT fieldsYesYesYesYesYesNoNoYes
Peer to peer channelsYesYesYesYesYesYesYesYes
PushWeb PushWeb PushWeb PushWeb PushWeb PushAPNs and FCMAPNs and FCMWeb Push

One schema, every client

All clients read the same .surql schema. spky generate writes the TypeScript and Dart types from the clientTypes entries in sp00ky.yml, and Rust apps generate theirs from a build.rs. See Generated types.

Guides