@vaultkeepr/sync
v0.1.3
Published
CRDT-based vault synchronization engine — Automerge-powered conflict-free merge for VaultKeepR
Maintainers
Readme
@vaultkeepr/sync
Cross-device vault synchronization for VaultKeepR, built on Automerge CRDTs. Conflict-free merges across devices, with tombstones so deletions propagate correctly.
Install
npm install @vaultkeepr/syncRequires @vaultkeepr/core.
Usage
import { createEmptyDoc, addEntry, updateEntry, deleteEntry, mergeDocuments } from "@vaultkeepr/sync";
// Device A
let docA = createEmptyDoc("device-a");
docA = addEntry(docA, entry);
// Device B
let docB = createEmptyDoc("device-b");
docB = updateEntry(docB, editedEntry);
// Merge — order does not matter, result is identical
docA = mergeDocuments(docA, docB);
docB = mergeDocuments(docB, docA);Tombstones keep deletions in sync: deleteEntry records a tombstone, and purgeTombstones / countTombstones manage the log. Legacy non-CRDT payloads can be migrated with migrateLegacyPayload / detectPayloadFormat.
Security notes
The CRDT binary import surface is fuzzed in CI (fuzz/harness/sync.fuzz.js): malformed Automerge input must fail with a clean Error, never a crash.
Repository: VaultKeepR/vaultkeepr-public · Site: vaultkeepr.xyz
MIT licensed.
