Replicator Playbooks
Step-by-step guides for deploying the real-time bridge across environments.
Replicator Playbooks
Next.js real-time UI
- Scaffold template:
npx @entityauth/cli bridge scaffold entity-auth --node entityauth:bridge:postgres-prisma - Install dependencies & generate Prisma client:
cd entity-auth/templates/postgres-prisma npm install npx prisma generate - Configure environment variables (
.env.local):CONVEX_URL=https://<deployment>.convex.cloud WORKSPACE_TENANT_ID=workspace_123 CONVEX_REPLICATOR_TOKEN=ct_... DATABASE_URL=postgresql://... - Start the bridge:
npx @entityauth/cli bridge start entity-auth --node entityauth:bridge:postgres-prisma - Run your Next.js app (
npm run dev) using the synchronized database. - Monitor health with
bridge status. - Publish local mutations via the template’s
publishExternalMutationhelper.
Background worker (Node)
- Scaffold or compose your own project using
@entityauth/replicator. - Ensure persistent storage for offsets (SQLite file, Redis, etc.).
- Deploy under
systemd, PM2, or containers; callstop()on shutdown. - Automate health reporting with periodic
bridge heartbeat.
Serverless batch (cron)
- Create a handler that runs
runBridgeonce with a customwaitFn. - Schedule the job (Cloudflare Cron, AWS EventBridge, etc.).
- Persist offsets in a durable store (Cloudflare DO, Redis, etc.).
- On each invocation, resume from the stored cursor and exit cleanly.
Memory demo
Use for quick validation or integration tests:
npx @entityauth/cli bridge scaffold entity-auth --node entityauth:bridge:memory-demo
npx @entityauth/cli bridge start entity-auth --node entityauth:bridge:memory-demo
Common knobs
eventsPerBatch– balance throughput vs latency.retry– tune exponential backoff behaviour.applyExternalMutationAction– enable bi-directional sync.logPath– send structured logs to your platform.
Consult the operations guide for security and monitoring.