Embedded Signup for Mesvilo

Guided onboarding with Meta's own flow: your customers choose their business, link a WhatsApp Business account, choose and confirm the phone number and see the connection status — without copying tokens or IDs. Manual setup stays available. Embedded Signup does not bypass Meta verification or permissions: business verification, display-name review, messaging limits and template approval stay with Meta.

Install

1. Copy the embedded-signup folder into addons/ of your Mesvilo installation.

2. Run php artisan migrate (creates embedded_signup_connections).

3. Platform admin → Add-ons → enable Embedded Signup.

Configure (platform admin → Embedded Signup)

The page contains the full checklist. In short, in Meta for Developers:

1. Create a Business app connected to your verified business portfolio.

2. Add the WhatsApp and Facebook Login for Business products.

3. Facebook Login for Business → Configurations → create a configuration with the WhatsApp Embedded Signup variation (System-user token, WhatsApp accounts asset, whatsapp_business_management + whatsapp_business_messaging). Copy the Configuration ID.

4. Allow your domain for the JavaScript SDK (HTTPS).

5. Paste App ID, App secret (stored encrypted), Configuration ID and Graph API version. Optionally a system-user token that is used to subscribe the app to the WABA and register the number.

6. WhatsApp → Configuration → Webhook: set the app-level Callback URL and Verify token shown on the page, subscribe to messages (and message_template_status_update).

7. Complete App Review / Advanced Access and switch the app to Live.

Why an app-level webhook?

Core Mesvilo gives each manually connected number its own callback URL. A Meta app has a single WhatsApp webhook, and every number onboarded through Embedded Signup belongs to your app, so all their events arrive at one URL: /webhooks/embedded-signup/{key}. The add-on checks Meta's X-Hub-Signature-256 with your App secret and forwards each change to the core webhook processor of the workspace that onboarded that phone_number_id. Only numbers proven through Embedded Signup receive forwarded events.

Use (workspace → WhatsApp)

Users with the *Workspace & WhatsApp settings* permission see Connect with Facebook above the manual form. After Meta's popup closes, Mesvilo:

1. exchanges the code for a business token (GET /oauth/access_token),

2. fetches the phone number details,

3. creates or updates the workspace's WhatsApp number (same fields as the manual form),

4. subscribes your app to the WABA (POST /{waba_id}/subscribed_apps),

5. registers the number for Cloud API (POST /{phone_number_id}/register) with the 6-digit PIN the user entered or one generated and shown.

The result screen lists every step with Meta's error message, and failed steps can be retried. Like the manual form, a workspace manages one number: connecting updates the existing number record.

Demo mode (MESVILO_DEMO=true) shows the flow and simulates a successful connection without calling Meta.


Mesvilo core documentation: mesvilo.com/docs · Support: mesvilo.com/contact