wats.sh
Reference

Reference Index

Every WATS reference doc and when to reach for it.

canonical · applies to 0.3.x-alpha · reviewed 2026-05-02

Graph primitives (@wats/graph)

DocWhen to use it
reference/client.mdConstructing a GraphClient; construction-time validation; request lifecycle.
reference/endpoints.mdDefining a new endpoint with defineEndpoint; path templates, param kinds, body passthrough.
reference/scoped-clients.mdBinding a phoneNumberId or wabaId into a PhoneNumberClient / WABAClient.
reference/calling.mdWhatsApp Calling lifecycle, call permissions, call-button/deep-link helpers, calling webhooks, and operator constraints.
reference/groups.mdWhatsApp Groups endpoint contracts, limits, webhook outcomes, service opt-in routes.
reference/errors.mdThe error registry; every pywa error code → WATS subclass; classification rules.
reference/pagination.mdpaginate / paginateAll; cursor extraction; AbortSignal; PaginationError taxonomy.
reference/media.mdMedia runtime: upload, metadata, binary download, delete, encrypted decrypt, upload sessions, and Node/Bun path helpers via @wats/graph/node-media. Endpoint family subpaths: @wats/graph/endpoints/{messages,media,templates,flows,calling,business-management,groups}.

Core primitives (@wats/core)

DocWhen to use it
reference/webhook-normalizer.mdTranslating a raw Meta webhook envelope into a TypedUpdate discriminated union.
reference/filters.mdTyped-filter surface: brand, combinators, and built-ins.
reference/router.mdTypedRouter handle-based registration, observer seams, DispatchReport shape.
reference/whatsapp-facade.mdThe WhatsApp composition root; what it binds, what it exposes, when to bypass it.
reference/listeners.mdListener substrate: wa.listen({ ... }), timeouts, cancellation, registry lifecycle.

HTTP primitives (@wats/http)

DocWhen to use it
reference/webhook-adapter.mdWiring up a webhook endpoint: createWebhookAdapter core + Bun / Node / Fetch wrappers.
reference/webhook.mdLow-level verifyWebhookChallenge + validateWebhookSignature primitives.

Crypto primitives (@wats/crypto)

DocWhen to use it
reference/crypto.mdCryptoProvider seam; Node / Bun / WebCrypto adapters; typed error hierarchy.

Shared types (@wats/types)

DocWhen to use it
reference/types.mdDiscriminated-union domain types.

App-layer primitives

DocWhen to use it
reference/config.md@wats/config YAML/JSON schema, env-secret refs, validation, redaction.
reference/cli.md@wats/cli commands: init, setup, doctor, serve, openapi export, messages list/show.
reference/service.md@wats/service runtime-neutral standalone webhook/API service.
reference/persistence.mdDurable runtime state: SQLite + Postgres adapters, migrations, idempotency, outbox, message projection.
reference/service.mdGenerated OpenAPI 3.1 document and GET /openapi.json service route.

Guides

GuideWhen to use it
../guides/cli-init.mdConfig scaffolding, setup wizard, doctor, dry-run serve. Start here.
../guides/live-webhook.mdPublic HTTPS tunnel, live serve, webhook onboarding checklist.
../guides/transport-and-testing.mdInjecting MockTransport; consumer-fixture pattern.
../guides/groups-quickstart.mdCredential-free Groups flow from create through invite, approval, and group messaging.
../guides/deploy-docker.mdContainer deployment design scaffold — not a supported runnable image yet.
../guides/deploy-bun.mdDeploying a webhook on Bun.
../guides/deploy-node.mdDeploying a webhook on Node http.createServer.
../guides/deploy-cloudflare-workers.mdDeploying a webhook on Cloudflare Workers.

On this page