
Three composable primitives that work together — or independently — to keep state in sync from your database, through your network, into your apps and agents.
Sync from your database into your apps.
With partial replication, data delivery and fan-out.
Reactive client store for super-fast apps.
For sub-millisecond reactivity and instant writes.
Embeddable Postgres with reactivity and sync.
A full database inside your client or runtime.
Sync subsets of your Postgres into everything. A read-path sync engine that streams shapes from Postgres over plain HTTP. Cached at the edge, fanned out to millions of concurrent readers, with flat database load.
Define a shape on the server. Mount a collection on the client. Render a live query. Writes go through your existing backend.
A reactive client store for building super-fast apps. Sub-millisecond reactivity, instant local writes, and live cross-collection queries powered by differential dataflow.
Loads data from any source — including Postgres Sync and Electric Streams — with optimistic mutations that reconcile against your backend.
const todos = createCollection(
electricCollectionOptions({
shapeOptions: { url: "/api/todos" },
getKey: (row) => row.id,
}),
)
export function Todos() {
const { data } = useLiveQuery((q) =>
q.from({ todo: todos })
.where(({ todo }) =>
eq(todo.completed, false)),
)
return <List todos={data} />
}Embeddable Postgres with reactivity and sync. A lightweight WASM build of Postgres — under 3MB gzipped — that runs in the browser, Node.js, Bun and Deno, with built-in live query and sync primitives.
Pair it with Postgres Sync to keep an embedded Postgres database in sync with your cloud Postgres — for fully local, offline-capable apps.
Agents work on shared data — and they change it while users are still looking at it. Without sync, your UI shows stale state, users have to refresh, and teams lose track of what each agent is doing.
With Electric, every user, device, and teammate sees agent changes in real time. The same shared state powers multi-tab, multi-device, multi-user, and multi-agent collaboration — out of the box.
Sync makes your apps super-fast, with end-to-end reactivity, resilience, and built-in multi-user collaboration.
Build fast, modern apps like Figma and Linear. Sub-millisecond reactivity and instant local writes.
Read more →Build apps that work reliably, even with patchy connectivity. Resilient transport that ensures data is never lost.
Read more →Build multi-user, multi-agent apps that naturally support both real-time and asynchronous collaboration.
Read more →Build multi-step agentic workflows that survive crashes and restarts. Agents and workers resume from the same durable state.
Read more →Compose Postgres Sync with TanStack DB to ship a real-time feature in three moves: define a shape on the server, mount a collection on the client, render a live query.
export const ServerRoute = createServerFileRoute("/api/todos").methods({
GET: async ({ request }) => {
const url = new URL(request.url)
const origin = new URL("https://api.electric-sql.cloud/v1/shape")
url.searchParams.forEach((v, k) =>
ELECTRIC_PROTOCOL_QUERY_PARAMS.includes(k) &&
origin.searchParams.set(k, v))
origin.searchParams.set("table", "todos")
origin.searchParams.set("where", "user_id = $1")
origin.searchParams.set("params", JSON.stringify([user.id]))
return fetch(origin)
},
})export const todoCollection = createCollection(
electricCollectionOptions({
id: "todos",
shapeOptions: { url: "/api/todos" },
getKey: (row) => row.id,
}),
)
export function Todos() {
const { data } = useLiveQuery((q) =>
q.from({ todo: todoCollection })
.where(({ todo }) => eq(todo.completed, false)),
)
return <List todos={data} />
}Forward the request to your Electric instance. Keep the source secret on the server.
The shape is defined server-side, not by the client. The client can't ask for tables it shouldn't see.
Bind the where clause to the authenticated user — every client gets its own slice.
Shapes stream over plain HTTP. Cache, log and rate-limit them with the middleware you already use.
An Electric collection in TanStack DB — local, reactive, persisted.
Sub-millisecond reactivity over the local data. Updates flow in as the shape changes.
Deep dives into sync engine architecture, the agent loop, and building real apps on the stack.
Spin up the starter, point it at Postgres, and ship a real-time app on top of your existing stack.