P
Persist
Local-first storage SDK

Your data.
Everywhere.
In sync.

Persist is a local-first storage SDK with pluggable backends, automatic sync, and P2P encryption. One API for records, events, blobs, and key-value data.

app.ts
import { createStore } from "@cuitty/persist";

const store = createStore("notes", {  adapter: "sqlite",
  sync: { remote: "postgres",
          strategy: "last-write-wins" },
  encrypt: true,
});

await store.records.put("note-1", {  title: "Hello from Persist",
  body: "Syncs everywhere.",
});
$npm install @cuitty/persist

Everything you need for local-first storage

One SDK. Pluggable backends. Automatic sync. No vendor lock-in.

Local-First

Works offline. Syncs when connected. Your data lives on your device first.

Learn more

Pluggable Adapters

SQLite, Postgres, S3, P2P — swap backends without changing your code.

Learn more

Automatic Sync

Conflict-free replication with configurable strategies: LWW, merge, or manual.

Learn more

P2P Encryption

End-to-end encrypted with Ed25519 signing and envelope encryption.

Learn more

Multi-Class Storage

Records, events, blobs, and key-value — one unified API for all data shapes.

Learn more

Zero Lock-in

Portable archives. Export everything. Import anywhere. Your data is always yours.

Learn more

Adapter Capabilities

Each adapter supports a different subset of storage classes. Mix and match to fit your architecture.

Adapter RecordsEventsBlobsKV
SQLite
Postgres
S3
P2P (libp2p)

How it works

Persist sits between your application code and your storage backends, handling sync, encryption, and conflict resolution automatically.

App Code
   │
   ▼
┌─────────────┐
│ Persist SDK │
└──────┬──────┘
       │
  ┌────┴────┐
  ▼         ▼
Adapter   Sync Engine
Registry       │
  │       ┌───┴───┐
  ▼       ▼       ▼
SQLite  Postgres  P2P
  S3              │
              Crypto
             Envelope
        

Start building with Persist

Get up and running in under 5 minutes. One install, one API, every backend.