Realtime sync, live on this page
convex-svelte realtime by default.
Real-time Convex integration for Svelte/SvelteKit. The demo below is backed by live queries — open a second tab and watch it sync.
$ npm i convex-svelte
Chat Demo
usePaginatedQuery · optimistic updatesconst messages = usePaginatedQuery(
api.messages.paginatedList,
{ searchWords: [] },
{ initialNumItems: 3, keepPreviousData: true }
);
// optimistic send: shows instantly, reconciles on server confirm
client.mutation(api.messages.send, { author, body }, {
optimisticUpdate: (store) => {
const first = store
.getAllQueries(api.messages.paginatedList)
.find((q) => q.value && q.args.paginationOpts.cursor === null);
if (!first?.value) return;
store.setQuery(api.messages.paginatedList, first.args, {
...first.value,
page: [{ author, body, optimistic: true }, ...first.value.page]
});
}
});- me Jul 1, 2026 Server
dd
- me Jul 13, 2026 Server
dfdfghfgh
- me Jul 13, 2026 Server
fgh