Get in Touch

Have a question about the platform, need help with your integration, or want to discuss partnership opportunities and enterprise pricing? Drop us an email — we’ll do our best to get back to you within 3–4 hours.

contact@fiwano.com
Documentation menu

Working with an AI agent? Download the full documentation as a Markdown file to use as context.

Download full .md

WhatsApp, Instagram & Messenger in Apps Built with AI

You are building an app in Lovable, Bolt, Replit, Base44, v0, Emergent, Rocket or Hercules, and it needs to talk to people where they already are: WhatsApp, Instagram DMs and Facebook Messenger. This guide shows how to add all three with Fiwano, what to tell your builder, and the few platform details that decide whether webhooks arrive.

What the builders offer on their own

Some builders already ship a messaging option. Check it first — if it covers your case, you don't need anything else. As of October 2026:

  • Lovable has a WhatsApp Business connector: one business number per connection, no Instagram or Messenger, and no way for your app's own customers to connect their numbers.
  • Base44 can put an in-app AI agent on WhatsApp, on a number Base44 assigns to the agent rather than your business number.
  • Replit, Rocket and Emergent offer Twilio (SMS, and WhatsApp through Twilio on Emergent). The Instagram connectors on Replit and Rocket read posts and feeds, not DMs.

When Fiwano fits

  • All three channels through one API — WhatsApp, Instagram DMs and Messenger arrive in one webhook format and are answered with one send call.
  • Your customers connect their own accounts. If you are building a SaaS, each of your customers can connect their own WhatsApp number, Instagram account or Facebook Page through a hosted flow, and your app receives a channel_id for it. See Channels.
  • Your own number and brand, and no Meta developer app to create or review — Fiwano is a verified Meta Tech Provider.

How the integration works

Every builder produces the same four pieces. The step-by-step version with payloads is the Quickstart.

  1. API key as a backend secret. Create a key in the Fiwano portal and store it in your builder's secrets, never in a variable that reaches the browser (such as VITE_… or NEXT_PUBLIC_…). Send it as the X-API-Key header, or as Authorization: Bearer if a tool only supports bearer tokens.
  2. A connected channel. Connect it in the portal, or let your customers connect theirs through the API.
  3. A webhook receiver. A backend function with a public HTTPS URL. Set it as the channel's webhook_url and enable message.received in webhook_events — delivery is opt-in. Verify X-Webhook-Signature, answer 200 right away and process afterwards; see Retry policy.
  4. Replies from the backend. POST /api/v1/messages/send with the webhook's channel_id and data.from as recipient.

Fiwano does not keep message history. If your app shows conversations, store incoming and outgoing messages in your own database.

A prompt to paste into your builder

One sentence is enough — the full API and webhook contract is in llms-full.txt, written for AI agents:

Add WhatsApp, Instagram and Messenger messaging to this app with Fiwano, following https://fiwano.com/llms-full.txt.

When the builder asks for the API key, enter it as a secret. Then set the URL of the webhook endpoint it created as the channel's webhook URL in the Fiwano portal and send a test message from your phone.

Platform notes

Builder Backend code runs in Webhook URL Watch out for
Lovable Edge functions (Lovable Cloud) The function's URL (Cloud → Edge functions → Copy URL) Edge functions require a JWT by default and reject webhooks with 401 before your code runs. Ask Lovable to turn off JWT verification for the webhook function — the signature check is its authentication
Bolt Server functions (Bolt Cloud) or Supabase Edge Functions The function's URL On Supabase, the same JWT setting as Lovable
Replit Your app's server The deployment URL (*.replit.app) Point the webhook at the deployment, not the workspace preview
Base44 Backend functions (Deno) https://<your-app-domain>/functions/<name> Webhook calls carry no user session — the function reads and writes data as the service role
v0 / Vercel Next.js route handlers Your production domain Preview deployments sit behind Vercel's deployment protection and answer webhooks with 401
Hercules Convex backend A public API route Run slow work through a scheduled function, not inside the request
Emergent, Rocket The app's backend or Supabase Edge Functions The endpoint's URL Keep the API key in the platform's secrets

On serverless platforms, "process in the background" means the platform's own mechanism — for example EdgeRuntime.waitUntil() on Supabase Edge Functions or waitUntil() on Vercel. Work started without it can stop when the response is sent.

Connecting through a builder's connector

Several builders can register an external REST API once and reuse it across projects. This makes calling Fiwano easier; receiving messages still needs the webhook endpoint above.

  • Lovable — custom connector (workspace admin): API base URL https://fiwano.com, API key in a custom header X-API-Key, test request GET /api/v1/channels. Add the Quickstart as a knowledge file.
  • Base44 — workspace integration: import the OpenAPI spec from https://fiwano.com/api/v1/openapi.json and set the X-API-Key header.
  • Replit — custom connector: choose bearer token authentication and paste your API key.
  • Rocket — API import: import the same OpenAPI URL.

If something doesn't work

  • "Blocked by CORS policy" or "Failed to fetch" in the browser — the call is running in frontend code. Move it to a backend function.
  • No webhooks arrive — check that message.received is enabled on the channel, and that the endpoint answers 2xx (a platform 401 from JWT or preview protection looks like silence from your side). Fiwano emails you after repeated failed deliveries.
  • The bot answers twice — the handler waited for the AI reply before answering, so the webhook was retried. Answer first, then process, and deduplicate on message_id.

Building with n8n instead? See n8n Integration. Comparing approaches in general? See Ways to Connect.

Frequently asked questions

Can I add WhatsApp to an app built with Lovable, Bolt or Replit?

Yes. Store your Fiwano API key as a backend secret, call the API from a backend function, and receive messages on a public webhook endpoint. The guide includes a prompt you can paste into your builder.

Can my app's customers connect their own WhatsApp or Instagram?

Yes. Your backend requests a setup link, your customer connects their own WhatsApp number, Instagram account or Facebook Page in a hosted flow, and your app receives a channel_id for it.

Do I need a Meta developer app to use WhatsApp in my AI-built app?

No. Fiwano is a verified Meta Tech Provider, so you connect channels without creating or reviewing your own Meta app.

Why do Fiwano webhooks not reach my Lovable or Supabase function?

Supabase Edge Functions, which Lovable Cloud uses, require a JWT by default and answer webhooks with 401. Turn off JWT verification for the webhook function; the X-Webhook-Signature check authenticates the request.