Idempotent by default, even offline

Never lose a write

resource() and action() replace 200 lines of Workbox config, IndexedDB schema, and retry logic — with idempotency keys and cross-tab replay locks built in, so a queued mutation runs exactly once. Works with React, Next.js Server Actions, SvelteKit, Vue, React Native, and Tauri/Electron.

resources.ts
import { resource, action } from '@sweidos/eidos'
export const products = resource('/api/products', {
offline: true,
strategy: 'stale-while-revalidate',
})
export const createOrder = action(
async (payload: OrderPayload) => {
const res = await fetch('/api/orders', { method: 'POST', body: JSON.stringify(payload) })
return res.json()
},
{ reliability: 'neverLose', name: 'createOrder' },
)
const data = await products.json<Product[]>()

A reliability core, not just a cache

One config surface for caching, queuing, and replay — with the idempotency, locking, and conflict-resolution guarantees payments and inventory writes need.

neverLose reliability

Idempotency keys on every retry, Web Locks-coordinated replay across tabs, and queue schema migration — a queued write executes exactly once.

action()

Mutations queue when offline and replay in order once the network returns — with conflict-resolution presets (serverWins, clientWins, merge, custom).

resource()

Declare a fetchable endpoint once. Eidos handles caching strategy, freshness, and offline reads automatically.

Generated Service Worker

No hand-written Workbox config. Eidos generates the Service Worker and registers it for you.

Cache strategies built in

cache-first, network-first, and stale-while-revalidate — pick per resource, no boilerplate.

Every runtime, one queue contract

React, Next.js Server Actions, SvelteKit, Vue, React Native, and Tauri/Electron (SQLite-backed queue) — all share the same neverLose guarantees.

Web push, built in

Subscribe, route notification clicks, and resubscribe on key rotation — headless and tree-shaken unless imported.

Devtools & inspector

Live queue, cache state, and offline simulation — plus per-item cancel/retry and idempotency-key inspection.

Ship writes that survive offline, reloads, and retries

Install @sweidos/eidos and declare your first neverLose action in under five minutes.