Start here if you want the short version first. The sidebar walks through setup, core APIs as small building blocks, examples, hooks, and the heavier reference material — open whichever page answers your question.
Add the package and let the Vite plugin keep the service worker in sync.
npm install @sweidos/eidos
import { eidos } from '@sweidos/eidos/vite'import { defineConfig } from 'vite'
export default defineConfig({ plugins: [eidos()],})Mount the provider once at the root so the runtime can register the SW.
import { createRoot } from 'react-dom/client'import { EidosProvider } from '@sweidos/eidos'import { App } from './App'
const root = createRoot(document.getElementById('root')!)
root.render( <EidosProvider swPath="/eidos-sw.js"> <App /> </EidosProvider>)Keep resources and actions at module scope so replay can find them later.
import { resource, action } from '@sweidos/eidos'
export const products = resource('/api/products', { offline: true })
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' },)A short checklist keeps the page from feeling like a wall of text.