A Convex client for Svelte that brings React's Convex hooks to Svelte. Built to match the features and developer experience of the React implementation.
I want Svelte to have the same Convex features and hooks that React enjoys. The official convex-svelte package is slow to update and missing functionality that React developers take for granted. This is my attempt to bridge that gap and give Svelte developers feature parity.
-
createQuerywith conditional skip -
createCursorPaginationwith conditional skip -
createMutationimplementation + Optimistic Update -
createActionimplementation - Better Auth + Convex integration for SvelteKit
- Composable UI helpers following shadcn/ui patterns
- Convelte manager - subscription manager and cache manager
Creates a reactive query that automatically updates when data changes. Supports conditional skipping and client-side caching.
// Basic usage - no arguments needed
const allTodos = createQuery(api.todos.list);
// With arguments
const todoById = createQuery(api.todos.get, () => ({
args: { id: '123' }
}));
// Conditional skip
const skippedTodos = createQuery(api.todos.list, () => ({
args: shouldSkip ? 'skip' : undefined
}));Creates a mutation function with built-in error handling and optimistic updates support.
// Basic mutation
const createTodo = createMutation(api.todos.create);
// With optimistic updates
const updateTodo = createMutation(api.todos.update, {
// Optimistic update logic
});
// Usage in event handlers
<button onclick={() => createTodo({ text: "New todo" })}>
Create Todo
</button>Under active development. Breaking changes likely as I figure things out. Maintained by 1 person.
MIT