Node Server Sync
@monoverse/voicebot-node is an npm package that pushes your Node.js catalog and content to
VoiceBot so the assistant can answer about your real products, categories and pages.
It is a producer client for the VoiceBot canonical signed-ingest contract: it pairs once, sends a full snapshot to establish a baseline, then streams small incremental deltas as your data changes. Everything runs server-to-server over an HMAC-signed HTTP protocol — no browser, no end-user involvement, no LLM SDK on your side. Voice and retrieval stay on the VoiceBot backend. It is the Node/TypeScript twin of the Laravel and WordPress sync producers.
┌──────────────────┐ gzip-NDJSON snapshot ┌──────────────┐
│ Your Node app │ + signed /events deltas │ VoiceBot │
│ + this package │ ───────────────────────────▶ │ ingest │
│ (entity │ HMAC-SHA256, https only │ (catalog, │
│ builders) │ │ RAG) │
└──────────────────┘ └──────────────┘
The widget answers questions using this data. Until a backend sync runs, there is nothing for it to talk about. Get the catalog in first.
The lifecycle at a glance
Four steps from an empty connection to a self-maintaining feed:
- Pair — exchange a one-time
VB-XXXX-XXXXcode for your tenant id + an encrypted shared secret. - Map — build canonical entities from your data with the typed builders (
product,category, …). - Snapshot —
client.snapshot(...)streams a complete baseline of every kind you emit. - Schedule — deltas every few minutes via
client.sendEvents(...), plus a periodic full to reconcile deletes.
Two channels, two keys
VoiceBot reads your store over two independent channels. They use different credentials and flow in opposite directions — don't confuse them.
| Data channel (this package) | Widget channel (browser) | |
|---|---|---|
| Direction | Your server → VoiceBot (push) | End-user browser ↔ VoiceBot (live) |
| Credential | HMAC shared secret (per-tenant, secret) | Publishable key pk_… (public, embeddable) |
| Obtained via | client.pair('VB-XXXX-XXXX') | Copied from the cabinet, dropped in a <script> |
| Carries | Catalog + content snapshots and deltas | Voice/text conversation traffic |
| Trust | Secret, encrypted at rest, never logged | Public identifier, safe to ship in markup |
The shared secret minted by pairing is stored encrypted at rest (AES-256-GCM, keyed by your
encryptionKey) and is never printed, logged, or returned in any output.
When to use it
Use this package when:
- Your storefront runs on Node.js (Express, NestJS, Fastify, a headless backend, a custom shop).
- You want the assistant to answer about live products, prices, stock, categories and pages.
- You can run a script on a schedule (cron, a worker, a platform scheduler).
You do not need this package if your store runs on WordPress/WooCommerce (use the WordPress sync plugin) or Laravel (use the Laravel package), or if you'd rather not run a producer at all.
If you can't run a producer, VoiceBot can ingest your store with no code on your side — a managed crawler reads your public pages, and supported platforms can be pulled read-only. See No-code & read-only alternatives.
What it sends
The package maps your data to VoiceBot's canonical entity schema via typed builder functions and
emits the kinds you have — products, categories, pages and more. Money is integer minor units,
categories/tags are slug lists, and page.contentText is plain text; the builders enforce
these. See Mapping for how to build entities and Syncing for how to
push them.
Requirements
- Node.js 18+ (uses built-in
node:cryptoand globalfetch; zero runtime dependencies). - A full-entropy 32-byte
encryptionKeyto encrypt the stored shared secret (openssl rand -hex 32). - A reachable VoiceBot ingest endpoint over https (
localhostis allowed for local dev).
The five-minute path
- Install & pair —
npm install, construct the client, exchange a pair code. - Map your data to canonical entities.
- Push a baseline:
client.snapshot(catalog()). - Sync deltas + a periodic full.
- Operate it —
status,unpair, retries, scheduling.
Next steps
- Installation & pairing — install, construct the client, pair.
- Ingest Protocol Reference — the contract this package implements.
- Tenant isolation — how the HMAC plane stays scoped to your tenant.
- Runnable example app — a complete
clone → runNode ingest project (pair → snapshot → events → status).