# How to Vibe Code Your Own Wabery (and Stop Paying for It)

> WhatsApp API for AI agents

- Site: https://wabery.com
- Category: Developer Infrastructure
- Verdict: **Serious undertaking** (35/100 vibecodeable)
- Estimated effort: 4-6 weeks of full-time systems engineering

## Verdict

Build a focused single-tenant personal subset or keep paying, because managing Meta's complex cryptographic Flows handshake, webhook retry queues, and sandboxed TypeScript execution engines requires building a full backend-as-a-service platform from scratch.

Wabery is a sophisticated developer infrastructure layer masking immense Meta Graph API complexity. While you can build a personal Express/Next.js wrapper that talks directly to the Meta Cloud API for simple message sending and receiving, reproducing Wabery's core differentiator — WhatsApp Flows asymmetric encryption, signed webhook retry queues, a hosted TypeScript serverless runner, and an MCP server for AI coding agents — represents weeks of grueling infrastructure work that easily justifies paying for the managed service.

### What you can't replicate

- Official Meta Business Partnership compliance standing and instant WhatsApp Business number onboarding
- Built-in carrier fee pass-through accounting and micro-dollar wallet infrastructure
- Ready-to-use production WhatsApp Sandbox phone infrastructure

## What it does

Developer-focused messaging platform and unified API layer for WhatsApp Business, Instagram Direct, and Facebook Messenger, featuring WhatsApp Flows, signed webhooks, hosted TypeScript functions, and native MCP servers.

### Core features

- Unified Channels API (WhatsApp, Instagram, Messenger)
- WhatsApp Flows JSON authoring, RSA/AES encryption handshake, and secure data-exchange webhook routing
- Signed Event Webhooks with cryptographic signatures (v1=...), retries, and health tracking
- Managed Shared Inbox, conversation threads, and contact states
- Hosted TypeScript runtime sandbox for automated routing, replies, and tool execution
- CLI (@wabery/cli) and Model Context Protocol (MCP) server support for AI agent integration

## The business

### Pricing

- Free: $0
- Paid Capacity Blocks: $15/mo+

## The hard parts

- Meta Cloud API business verification, webhook token challenges, and navigating strict 24-hour customer service conversation windows
- WhatsApp Flows asymmetric encryption handshake (RSA/AES payload decryption/encryption)
- At-least-once webhook delivery engine with exponential backoff retries and cryptographic signature generation
- Secure, isolated serverless JavaScript/TypeScript runtime sandbox for running arbitrary third-party automation functions safely
- Short-lived Meta media URL ingestion, re-signing, and local/cloud storage caching before expiration

## How to vibe code Wabery

### Prerequisites

- Node.js (free): Required for running the TypeScript backend runtime and CLI tools
- GitHub (free): Source code repository and CI/CD deployment pipelines
- Meta Developer Account (free): Mandatory for obtaining WhatsApp Business API credentials and setting up webhooks

### Recommended AI tools

- Claude Code: Best-in-class multi-file agentic coding tool for scaffolding complex backend infrastructure and CLI clients in the terminal
- Cursor: AI-native code editor for reviewing complex webhook crypto handlers and database schemas with diff previews

### Stack

- Frontend: Next.js
- Backend: Node.js / Express API server
- Database: Turso
- Auth: better-auth
- Payments: Stripe
- Other: Upstash Redis for webhook retry queues, Vercel AI SDK

### Hosting

- Fly.io (Hosting the Node.js backend API, webhook workers, and isolated function execution runner): $5-10/mo
- Vercel (Hosting the Next.js developer dashboard web frontend): $0/mo

### Build guide

1. **Project Scaffolding & Database Schema** — Initialize the monorepo structure with a Next.js dashboard frontend, Express backend server, and Turso SQLite database schema for projects, channels, contacts, conversations, messages, and webhook logs.

```
Create a full-stack project structure using Next.js for the dashboard and an Express Node.js server for the messaging API layer. Set up Turso with libSQL for the database. Design the relational schema including tables for projects, channels (storing Meta access tokens and phone numbers), contacts, conversation threads, and message history logs. Include a robust configuration-as-code parser in TypeScript that supports exporting and applying project definitions.
```

2. **Meta Cloud API Integration & Message Routing** — Implement core API endpoints and SDK methods to send and receive text and media messages across WhatsApp, Instagram, and Messenger channels via the Meta Graph API.

```
Implement the messaging engine in the Express backend that interfaces with the Meta Graph API. Build REST endpoints and a TypeScript SDK wrapper (`@wabery/sdk`) for sending text, media (images, documents, audio), and template messages. Implement inbound webhook verification routes (`GET /webhooks/meta`) conforming to Meta's token challenge protocol and handle inbound message parsing into normalized conversation events.
```

3. **WhatsApp Flows Cryptography & Data Exchange** — Build the encryption/decryption handshake engine required for handling WhatsApp Flows payload exchange and dynamic form data submissions securely.

```
Implement the cryptographic security layer for WhatsApp Flows. Write utility modules to handle RSA private key decryption and AES-128-CBC payload decryption for inbound Flow data exchange requests, and encrypt responses back to Meta according to official WhatsApp specifications. Build an endpoint handler that validates Flow payloads, executes associated data-exchange logic, and returns structured form submissions.
```

4. **Signed Event Webhooks & Retry Queue** — Create a reliable outbound webhook delivery system that dispatches signed cryptographic events with exponential backoff retries and endpoint health tracking.

```
Build an outbound webhook dispatch engine using Upstash Redis queues. When inbound messages or status events arrive, sign the payload using HMAC-SHA256 with an endpoint secret (`v1=...`) and deliver HTTP POST requests to customer webhook targets. Implement an exponential backoff retry worker for failed deliveries (HTTP non-2xx responses) and track endpoint health metrics (success/failure rates) in the database.
```

5. **Hosted Functions Sandbox Runtime** — Develop a server-side TypeScript execution runtime that safely executes project-scoped automation scripts and tool handlers without risking host stability.

```
Create a secure server-side TypeScript function runner in Node.js using isolated-vm or controlled child processes. Allow users to deploy project-scoped handler scripts that receive a context object (`Ctx`) with database access, fetch utilities, and helper methods for sending messages. Implement deployment APIs, invocation log streaming, and error boundary isolation.
```

6. **CLI & Local MCP Server** — Build a command-line interface tool and local Model Context Protocol (MCP) stdio server so AI agents like Claude Code and Cursor can manage project configurations and workflows.

```
Build a CLI tool (`@wabery/cli`) in TypeScript supporting commands like `login`, `channels list`, `flows apply`, and `functions deploy`. Additionally, implement a local MCP server over stdio that exposes Wabery resources (projects, channels, contacts, messages, flows, hosted functions) as agent-callable tools. Ensure write operations require proper confirmation tokens and respect secure local session boundaries.
```

### Cost vs paying

**Starting costs (one-time):**

- Domain name: $12/year
- Total: ~$12 one-time

**Ongoing costs (monthly):**

- Fly.io & Database hosting: $10/mo
- Meta WhatsApp Carrier Fees: At cost (Variable)
- Total: ~$10/mo + carrier usage

- Paying for the SaaS instead: $15/mo (Capacity tier)
- Build time: 80-120 hours
- AI tool credits: $20 (Claude Pro)
- Break-even: N/A (Built for developer control and education)

## Sources

- [Wabery Official Website & Home Page](https://wabery.com)
- [Wabery Documentation Overview](https://wabery.com/docs)
- [Wabery WhatsApp Pricing & Rate Cards](https://wabery.com/docs/whatsapp-pricing)
- [Wabery WhatsApp MCP Server Guide](https://wabery.com/docs/mcp)
- [Wabery Quickstart Guide](https://wabery.com/docs/quickstart)
- [Wabery CLI Documentation](https://wabery.com/docs/cli)