VibeCodeStorage Node storage SDK reference — client 0.2.2 Available as npm vibecodestorage@0.2.2 and the standalone download. Both support Node 22+ and structured retry timing. This reference covers the account-free storage SDK, not vibecodestorage/auth. Node 22+. No runtime dependencies or install scripts. MIT client source: https://github.com/halfpenny-technologies/vibecodestorage-client import {VibeCodeStorage, VibeCodeStorageError} from 'vibecodestorage'; Or import from the reviewed ./sdk-standalone.mjs download. Credentials = {endpoint, storeId, accessToken, encryptionKey}. All but endpoint are private. Entry = {key: string, value: T, version: number}. JSON values only: null, booleans, finite numbers, strings, arrays and objects. Labels must be 1–256 UTF-8 bytes. Types ship as src/sdk.d.ts. Method | Result | Requests per successful normal call VibeCodeStorage.createRequest({endpoint?}) | {endpoint, requestId, encryptionKey}; local only; save privately BEFORE networking | 0 VibeCodeStorage.create({endpoint?,creationRequest?}) | Promise<{store, metadata}> | 1 creation request; one retry for uncertain transport/5xx errors with identical request; no retry for 429 new VibeCodeStorage(credentials) | reusable store; no provisioning | 0 store.info() | Promise | 1, monthly-quota exempt store.get(key) | Promise | 1 store.getEntry(key) | Promise | 1 store.set(key,value,{version:0}) | Promise<{id,version}>; create only | 1 store.set(key,value,{version:knownVersion}) | Promise<{id,version}>; conditional update | 1 store.set(key,value) | same result; reads current version first | 2 (including missing-row read) store.list() | Promise; all records, decrypted locally, no pagination | 1 store.delete(key,{version:knownVersion}) | Promise<{deleted:true}> | 1 store.delete(key) | same result; first reads current version | 2 store.export() | Promise<{format:'vibecodestorage/plaintext-v1',exportedAt:ISO date,rows:Entry[]}> | 1, monthly-quota exempt store.destroy() | Promise<{deleted:true}>; deletes whole store | 1, monthly-quota exempt; explicit operator decision Creation is separately admission-limited. Authenticated row requests, including failed requests, consume the monthly allowance. Exempt endpoints still have burst limits. list/export ordering is by opaque row identifier; sort decrypted results yourself. Export contains plaintext and must be protected. sdk.set returns an opaque id, not the original key. Metadata from info() or create(): {storeId, accessRole:'owner'|'read'|'edit', requestsUsed:number, createdAt:ISO date, freeUntil:ISO date, plan:'starter', status:'active'|'provisional', activationDeadline:ISO date|null, rows:number, bytes:number, limits:{rows,bytes,requestsPerMonth}, pricing:{currency:'GBP',starterAnnual,plusMonthly,billingEnabled:false}, notice:string} Pricing is indicative legacy metadata, not a purchase or uptime/retention promise. Usage is encrypted-envelope bytes, including encryption/base64 overhead. Efficient editing: const entry = await store.getEntry('settings'); // keep this value/version in app state const saved = await store.set('settings', {...entry.value, theme:'light'}, {version:entry.version}); entry.value = {...entry.value, theme:'light'}; entry.version = saved.version; // never assume version + 1: revisions are store-wide // Later delete, only if requested: await store.delete('settings',{version:entry.version}); Cache a successful read in request/session/app state with a deliberate refresh policy. Use versions from that cached entry; on 409 reload and let the app merge or show the conflict. Invalidate cached entries after writes/deletes and when another client may have changed data. There is no SDK-wide cache because freshness, multi-user access and memory lifetime belong in the app. Never share a cache across stores or users without explicit isolation. Activation: write meaningful application data once within four hours; version:0 creates without a preflight read. openStore saves credentials but does not manufacture activity. A local-start demo may create default settings once and treat only VERSION_CONFLICT as already initialised. Auth's setup helper already activates its management store. Latency: each request is a network round trip; no latency SLA. Passing versions avoids an extra read. Combine closely related settings in one record where appropriate. For independent records use bounded concurrency, not unbounded Promise.all; there is no multi-record transaction or atomic batch API. Preserve drafts and show Saving until acknowledgement. Several dependent writes can take seconds; benchmark from your deployment rather than assuming a fixed RTT. Errors: API failures throw VibeCodeStorageError with message, status and code. retryAfterSeconds and retryAt are optional in 0.2.2+ when supplied by the API. Transport timeouts/fetch failures, invalid credentials/values and decryption errors can be ordinary Error/TypeError/DOMException. Do not assume every exception has code/status. Never log credentials, values or raw exports. Common codes on account-free storage routes (share management and Auth have additional errors/contracts): 400 INVALID_URL, INVALID_JSON, EMPTY_BODY_REQUIRED, INVALID_CREATION_ID, INVALID_ENVELOPE, NONCE_REUSE — correct input; let the SDK generate encryption nonces. 401 UNAUTHORIZED — restore the correct saved credentials; do not recreate the store automatically. 402 RENEWAL_REQUIRED — write period ended; read/export grace applies; billing is disabled. 403 ORIGIN_DENIED — deployment origin policy rejected the request; changing tokens/retrying cannot fix it. Hosted public bearer storage permits browser origins; admin/Auth have separate restrictions. 404 NOT_FOUND, ROW_NOT_FOUND — distinguish absent route from absent record. 405 METHOD_NOT_ALLOWED — correct method/path. 409 VERSION_CONFLICT — refresh/merge rather than overwrite blindly. 410 PROVISIONING_EXPIRED — first-write deadline passed or saved creation request targets a removed store; explicitly start a fresh setup only after explaining expiry. 410 STORE_EXPIRED — read/export grace ended. 413 BODY_TOO_LARGE, ROW_LIMIT, STORAGE_LIMIT — reduce payload/usage. 415 JSON_REQUIRED — send application/json. 428 VERSION_REQUIRED — supply a valid conditional version. 429 RATE_LIMIT, PROVISIONING_RATE_LIMIT — preserve state, obey retry timing; no polling loop. 429 MONTHLY_LIMIT — wait until the next UTC calendar month; the generic Retry-After does not replenish quota. info/export remain available. 503 PROVISIONING_PAUSED, CAPACITY_LIMIT, PROVISIONAL_CAPACITY — stop provisioning visibly; existing stores may remain usable. 503 BUSY — transient server/database contention; preserve state and report the failure. 500 INTERNAL_ERROR — unexpected service failure; report safely without record contents. Terms: https://vibecodestorage.com/terms.html Quickstart and path selection: https://vibecodestorage.com/quickstart.txt