Your app's live data is accessible outside the browser — from Node, Deno, Bun, Cloudflare Workers, or any runtime that can run npm packages.
Login once per device — stores a device cert in your keybag.
Install the package. Works with npm, pnpm, and yarn.
// Deno / Bun: import { fireproof } from "https://esm.sh/use-vibes@2.2.18"
Connect to the same database that backs your Vibes app. You need two things from your vibe's URL (vibes.diy/vibe/userSlug/appSlug): the appSlug, and the database name your App.jsx passes to fireproof().
fireproof("todos", { appSlug }) — opens the named database within that vibe; pass appSlug explicitly so the script works from any directoryput(doc) — write a document; returns { id, clock }get(id) — fetch a document by idquery(field, opts) — index query by field valuesubscribe(fn, true) — live updates over WebSocket; second arg fires immediately with current stateWhen you call fireproof("todos") with no options, these defaults apply in order.
| Field | Default |
|---|---|
| apiUrl | VIBES_DIY_API_URL env var, then https://vibes.diy/api |
| appSlug | VIBES_APP_SLUG env var, then basename(process.cwd()) — pass explicitly to avoid connecting to the wrong vibe |
| getToken | device cert from npx vibes-diy login keybag |
| userSlug | looked up automatically from your account on first request |
For CI, Wrangler, or service accounts — environments without a device keybag.
These rules apply per process — important for long-running scripts and Workers.
fireproof("todos") === fireproof("todos") — same name returns the same instance within a process_files field) are not yet supported — pure document workflows onlyThese are the only methods. Do not use others.
| Method | Notes |
|---|---|
| put(doc) | Write a document. Returns { id, clock }. verified |
| get(id) | Fetch a document by id. verified |
| del(id) | Delete a document by id. verified |
| query(field, opts) | Index query by field value. verified |
| subscribe(fn, runNow?) | Live updates over WebSocket. Second arg fires immediately. verified |
| allDocs(opts?) | Fetch all documents. listed, unverified |
| bulk(docs) | Batch write. listed, unverified |
Open your Vibes app, grab the appSlug from its URL and the database name from your App.jsx, and start reading data from your script.