Zero-Knowledge
Your data is encrypted client-side before it leaves the browser. The server only stores opaque blobs.
npm install @zod-vault/zustand @zod-vault/client @zod-vault/cryptoZero-Knowledge
Your data is encrypted client-side before it leaves the browser. The server only stores opaque blobs.
Drop-in Replacement
Swap persist() for vault() and keep your existing store logic. One line change.
Self-Hostable
Single Docker image, SQLite storage. No external databases. Your data, your server.
Offline-First
Works without network. Changes queue locally and sync when you’re back online.
import { create } from "zustand";import { vault } from "@zod-vault/zustand";
const useStore = create( vault( (set) => ({ notes: [] as string[], addNote: (note: string) => set((s) => ({ notes: [...s.notes, note] })), }), { name: "my-notes", recoveryKey: "ABCD-EFGH-IJKL-MNOP-QRST-UVWX-YZ23-4567", server: "https://vault.example.com", getToken: () => client.getToken(), } ));
// Sync across devicesawait useStore.vault.sync();| Package | Description | Size |
|---|---|---|
@zod-vault/crypto | Encryption primitives (Argon2id, AES-256-GCM) | 3.5 KB |
@zod-vault/zustand | Zustand middleware | 5.7 KB |
@zod-vault/client | Auth client + React hooks | 6.6 KB |
@zod-vault/server | Self-hosted backend | 8.0 KB |