The same Fireproof database that powers your Vibes app is reachable from any JavaScript runtime. Subscribe to live changes, write records from cron jobs, build webhooks, sync to external services — without ever leaving your stack.
use-vibes is the bridge between the database inside your Vibes app and the rest of your infrastructure.
Install it anywhere npm packages run, point it at your app's appSlug, and you have full read/write access with live WebSocket subscriptions.
WebSocket-backed subscribe() fires your callback on every change — from any connected writer, anywhere in the world.
put, get, del, query. Write records from scripts, crons, or service workers. Read them back with index queries.
Reuses the device cert from npx vibes-diy login. No API keys to rotate, no separate service account to manage.
Multiple fireproof() calls in one process share one WebSocket connection. Scale to hundreds of databases without multiplying sockets.
Deploy to Cloudflare Workers or AWS Lambda. Pass explicit getToken and userSlug for stateless, CI-friendly execution.
Import from npm or directly via esm.sh for Deno / Bun. No build step required for scripting use cases.
Authenticate once per device.
Install the package.
Then connect to your app's database. You need the appSlug from its URL (vibes.diy/vibe/<userSlug>/appSlug) and the database name your App.jsx passes to fireproof().
fireproof() is the database name — must match what your App.jsx usesappSlug scopes the connection to your vibe; pass it explicitly so scripts work from any directorysubscribe(fn, true) — second arg fires immediately with current state before WebSocket events arrivefireproof("todos") call returns the cached instance within a process — one socket per processOnce your app's data is reachable from a script, the integration surface is unlimited.
Write a daily digest, expire old records, or seed fresh data on a schedule. A ten-line Node script + a cron is all it takes.
Subscribe to database changes and forward them to Slack, Discord, email, or any HTTP endpoint — without polling.
Wrap your Vibes database in a Cloudflare Worker or Lambda to expose validated REST or GraphQL endpoints to other clients.
Pull records with allDocs() or indexed queries, transform them, and push to a data warehouse, spreadsheet, or BI tool.
Batch-write initial data, migrate schema across document versions, or copy records between app slugs during development.
Subscribe to new user submissions and pipe them into an LLM workflow — summarize, classify, embed, or generate replies automatically.
Keep a mobile app, a dashboard, and a backend script all reading the same live database with zero reconciliation code.
Subscribe to error or event records written by your Vibes app and trigger PagerDuty, SMS, or email when thresholds are crossed.
npx vibes-diy login authenticates you and stores a long-lived device cert in a local keybag. Every subsequent call to fireproof() picks it up automatically — no tokens to copy, no env vars to set for local use.
Vibes apps live at vibes.diy/vibe/<userSlug>/<appSlug>. When you pass appSlug to fireproof(), the library resolves your userSlug automatically from your logged-in account and opens the matching database namespace.
All fireproof() instances in a process share one multiplexed WebSocket to the Vibes sync server. Open ten databases — you still have one socket. Subscriptions are demultiplexed automatically.
Records written from your backend script appear in the Vibes app's UI within milliseconds — the same sync path that handles browser-to-browser collaboration handles script-to-browser too.
For Cloudflare Workers, AWS Lambda, GitHub Actions, or any environment without a device keybag — pass all options explicitly.
VIBES_APP_SLUG in env to skip passing appSlug in every call — useful in single-app WorkersVIBES_DIY_API_URL to override the default API endpoint for staging or self-hosted installsfireproof() calls with different db names inherit them
Open your Vibes app, copy the appSlug from its URL, find the fireproof() call in App.jsx,
and run npx vibes-diy login. You'll have live data in your script in under five minutes.