TanStack DB: Introduction

@supabase-labs/tanstack-db syncs TanStack DB collections with Postgres through Supabase. Components re-render when the underlying data changes, with no manual cache invalidation. Mutations apply to the UI immediately and roll back if the server rejects them.

Realtime sync can use more Realtime messages than you expect, and @supabase-labs/tanstack-db is a 0.x release. Test with a spend cap, or set realtime: false on a collection to opt out. Collections fetch on the client. Server-side rendering (SSR) isn't supported.

Collections work with your Supabase project as it is and respect Row Level Security. No migration is required.

To see a working app, open the example Todo app.

The examples in this reference use React. TanStack DB also supports Vue, Angular, Solid, Svelte, and vanilla JavaScript. For setup in those frameworks, see the TanStack DB framework docs.