@livestore/sync-s2 provider uses S2 as the durable backend for the event log — every client materializes state by replaying ordered events from an S2 stream.
How it works
Each LiveStorestoreId maps to a single S2 stream. Events are JSON-serialized and appended as records, preserving their total order. Clients sync through a small API proxy that you run on your own server:
- Client — the LiveStore client pushes and pulls events through your proxy endpoint.
- API proxy — your server authenticates to S2, creates basins and streams as needed, and translates LiveStore sync operations into S2 API calls. The
@livestore/sync-s2package ships helpers for this, and is also where app-specific concerns like auth and rate limiting live. - S2 — stores the event log durably and streams live updates back to clients over SSE.
Prerequisites
- An S2 cloud account
- A scoped access token for your basin
Install
Resources
- LiveStore S2 sync provider — full setup guide, including the API proxy implementation
- LiveStore documentation

