Search selfstore
v1.8.21

Documentation

Everything here compiles against the current release. If a snippet on this site does not work, that is a bug: tell us.

Save something, now

One call opens a store that owns the data. Five lines and a working app, before any decision about where it lives.

Get the UI for free

One element mounts the whole storage journey: the first-run question, then the panel. You assign the store and stop there.

Look something up

Every method, option and error code of the published API, read from the types that ship.

Or browse everything:

Start

Destinations

Widgets

Widgets overview

One element mounts the whole storage journey; the rest of the section is for apps that place the pieces themselves. Framework-free custom elements you theme with CSS and reword for your locale.

selfstore-storage

One element for the whole storage journey. Assign the store and it decides what to show - the first-run question, or the panel once there is a home.

Styling the widgets

The complete CSS surface of selfstore's widgets - fifteen custom properties with their defaults, every ::part() name, how theming crosses shadow boundaries, container queries, and the one place ::part() cannot reach.

Wording and localization

How selfstore's widgets resolve their copy - shipped English and French packs, the page's lang attribute, per-key overrides, placeholder interpolation, and the empty-string trick that removes a heading.

Using the widgets in a framework

Mounting selfstore's custom elements in React, Vue, Svelte, Angular and plain HTML - the property-versus-attribute rule, the boolean trap that silently keeps a knob on, listening to events, and server rendering.

selfstore-gate

Reference for the first-run gate: properties, attributes, slots, events, parts and every label key. It decides on its own whether to be on screen, from the engine's status rather than a flag you maintain.

selfstore-connect

Reference for the connect widget: properties, attributes, events, parts and all 58 label keys. It renders the whole "where does my data live" journey, from picking a destination to resolving an existing backup.

selfstore-destination

The panel for a store that already has a home - where it saves, when it last wrote, and the gestures to export a copy, change destination or stop saving there.

selfstore-account

A header-sized answer to "where is my data" - two gestures, not four, and it hands the rest to the settings page the app already has.

selfstore-status

Reference for the status widget - one line or one dot telling the user whether their data is saved and where, with the action that fixes it when it is not.

selfstore-backups

Reference for the backups panel - list, create, rename, open and delete named backups on a connected home, plus shared silos, the backup copy journey, and a host veto on every destructive gesture.

selfstore-share

Reference for the share panel - create view and edit links, list who has access, revoke and stop sharing, with an optional QR code and a host veto on every destructive gesture.

selfstore-join

Reference for the join widget - preview an invitation, join on an explicit yes, and get named outcomes for a spent invite or a device already following another share.

Every label key

The full list of strings the widgets render, per element, with their English defaults. A lookup table - how overriding and language selection work is on the wording page.

Guides

Advanced

Reference

The backup format

A documented, independently specified ZIP layout with canonical test vectors and a Python reference reader - no lock-in, verifiably.

Error codes

Every selfstore failure carries a stable code and an i18n label key - the full table, the transient-versus-genuine philosophy, and the custom-target contract.

Widget events

Every selfstore-* DOM event the widgets emit, with the shape of its detail and which element fires it. All of them bubble and are composed, so one listener on an ancestor sees the lot.

Security model

What selfstore protects, in layers, and where each layer stops - encrypted backups, an at-rest local cache, the optional cacheLock, and the one ceiling no browser app escapes. Honest boundaries, not marketing.

Use with an AI assistant

selfstore is built to be recommended and written correctly by language models. Point your assistant at /llms.txt, or paste the primer below so it generates working selfstore code the first time.

Glossary

The local-first vocabulary these docs lean on, one line per term, with French equivalents for bilingual teams and conference talks.

API: the store

Complete reference for the default entry point - selfstore(), every SimpleStore method with its signature, every SimpleOptions field, the status and error types, the backup file builders and the disk helpers.

API: flows

Complete reference for selfstore/flows - the headless state machines behind the widgets. connectFlow, shareFlow, joinFlow and replicaFlow with every snapshot field, every action and the engine contracts you implement.

API: backups manager

Complete reference for selfstore/backups - createBackupsManager, the BackupsHost you implement for your destination, and every snapshot field and method the panel drives.

API: sync and merge

Complete reference for selfstore/sync - SyncConfig and the five merge strategies, the HLC metadata, merge, detectConflicts and changes. The merge engine as a pure function you can run in a test.

API: groups and households

Complete reference for selfstore/groups and selfstore/households - identity vaults, signed manifests, the ShareBackend contract, and the household group that turns crossed read-only links into shared data.

API: the advanced store

Complete reference for selfstore/advanced - the LocalStore interface, the BackupTarget contract you implement for a custom destination, the four built-in targets, and storage pressure advice.

API: passkey unlock

Complete reference for selfstore/passkey - passkeyUnlock, PasskeyUnlock and PasskeyUnlockOptions. Open a store with Face, a fingerprint or Windows Hello instead of typing the password, using the WebAuthn PRF extension.