---
title: Persist Quickstart
description: Install the Persist SDK and create your first store in under a minute.
section: Persist
order: 1
updatedAt: 2026-05-12
slug: persist/quickstart
---
# Persist Quickstart

## Install

```bash
# npm
npm install @cuitty/persist

# bun
bun add @cuitty/persist

# pnpm
pnpm add @cuitty/persist
```

## Create a store

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

const store = await createStore({
  name: "my-app",
  adapter: "sqlite",
  path: "./data/my-app.db",
});
```

## Basic CRUD

```ts
// Put a record
await store.records.put("users/alice", {
  name: "Alice",
  role: "admin",
});

// Get a record
const alice = await store.records.get("users/alice");

// List records by prefix
const users = await store.records.list("users/");

// Delete a record
await store.records.delete("users/alice");
```

## Enable sync

Add a `sync` block to push local writes to a remote backend automatically. Writes never block -- sync runs in the background.

```ts
const store = await createStore({
  name: "my-app",
  adapter: "sqlite",
  path: "./data/my-app.db",
  sync: {
    remote: "postgres",
    strategy: "last-write-wins",
  },
});
```

See [Sync & Conflict Resolution](/docs/persist/sync) for strategies and conflict handling.

## Enable encryption

Set `encrypt: true` to encrypt all data before it leaves the device. The sync server never sees plaintext.

```ts
const store = await createStore({
  name: "my-app",
  adapter: "sqlite",
  path: "./data/my-app.db",
  encrypt: true,
  sync: {
    remote: "postgres",
    strategy: "last-write-wins",
  },
});
```

See [End-to-End Encryption](/docs/persist/encryption) for key management and zero-knowledge architecture.