# Connect Custom code to WhatsApp | Novu Connect

> Give your Custom code agent a voice in WhatsApp with Novu Connect.

Canonical: https://www.novu.co/channels/whatsapp/custom-code/

Markdown: https://www.novu.co/channels/whatsapp/custom-code.md

No framework required. Connect the agent loop you already wrote to every channel your users are on. Novu Connect gives it a voice in WhatsApp.

Novu Connect is the communication layer, the ACI, Agent Communication Infrastructure, bridge between your custom agent and WhatsApp. Your agent keeps running in your app. Novu delivers its messages to WhatsApp, maps each user, and forwards their replies back to your handler. We never run your agent's reasoning. That is the whole point.

Connect command: npx novu connect --channel whatsapp --runtime custom-code

## What is Custom code

Custom code means the agent is fully yours: your own loop, your own model calls, your own tools, no framework in between. Novu does not care how your agent thinks. The bridge hands your handler each incoming message with its conversation context, and whatever your handler returns goes back to the user. That last mile, reaching a person in Slack and routing their reply back to your agent, is what Novu Connect adds.

- Any model provider and any agent loop you already run
- A plain handler: message in, reply out
- Conversation context and user identity handled for you
- No framework dependency to adopt

## How to connect Custom code to WhatsApp

1. Keep your agent: Your loop, model calls, and tools stay in your codebase exactly as they are. Novu Connect wraps the input and output, so your agent code does not change when you add WhatsApp.
2. Connect the channel: Run npx novu connect --channel whatsapp --runtime custom-code. The CLI scaffolds a bridge route in your app and connects WhatsApp. You can also paste the prompt below into your coding agent and let it wire the bridge for you.
3. Wire the bridge handler: The CLI prints a requirements file with the bridge route and handler. Point the handler at your agent: it receives each WhatsApp message with conversation context, and whatever it returns routes back to the same conversation.
4. Go live: Sign in to keep the agent live, then run your dev server. Your agent now holds a two-way conversation in WhatsApp, and the same agent can reach every other channel from one thread.

Prompt for your coding agent: Connect this project's Custom code agent to WhatsApp with Novu using instructions from https://novu.co/agents.md

## Custom code and WhatsApp, common questions

### My agent uses no framework at all. Does that work with WhatsApp?

Yes. That is what the custom-code runtime is for. The bridge is a plain handler: Novu passes in each WhatsApp message with its conversation context, and whatever you return goes back to the user.

### Does Novu run my agent?

No. Novu Connect is the communication layer, the ACI, Agent Communication Infrastructure, bridge between your agent and WhatsApp. You own the reasoning and the tools. We never run your brain, that is the whole point.

### Can I switch model providers later?

Yes. Novu only carries the conversation to and from WhatsApp. What happens inside your handler, including which model you call, is entirely up to you and can change at any time.

### How do I connect my AI agent to WhatsApp?

Connect WhatsApp from the Novu dashboard. Novu is an official Meta Business Partner, so the embedded signup lets you pick your business number and go live in about 5 minutes, then your agent talks to users through Novu Connect.

### Do I need my own WhatsApp Business account?

Yes. WhatsApp requires a verified business account through Meta. Novu Connect handles the connection with embedded signup, so you log in once and Novu manages templates, delivery, and two-way routing after that.
