@epicdm/flowstate-rxdb-d1
v1.0.8
Published
RxDB replication plugin for Cloudflare D1 + Durable Objects
Downloads
1,528
Readme
@epicdm/flowstate-rxdb-d1
RxDB replication plugin for Cloudflare D1 + Durable Objects.
Runs RxDB's replication protocol against a Cloudflare Worker backed by D1 (for storage) and Durable Objects (for per-user connection fan-out), enabling real-time offline-first sync between browser/Node.js clients and the edge.
Installation
yarn add @epicdm/flowstate-rxdb-d1
# or
npm install @epicdm/flowstate-rxdb-d1Peer dependency: rxdb ≥ 16.
Usage
Two subpath entry points are published:
// Client-side replication plugin (browser, Node.js)
import {} from /* replicator */ '@epicdm/flowstate-rxdb-d1/client'
// Shared types used by both the client and the Worker
import {} from /* shared types */ '@epicdm/flowstate-rxdb-d1/shared'Deploying the Worker
The package includes a wrangler-based Worker that backs the replication endpoint:
yarn deploy # production
yarn deploy:staging # staging environmentDrizzle is used for D1 schema migrations (yarn generate:migrations), and RxDB + Zod schemas can be regenerated with yarn generate:all.
License
Apache-2.0 © Epic Digital Interactive Media LLC
