Embedded Signup

What is Embedded Signup?

Embedded Signup is a Facebook-native flow that lets your end-users connect their WhatsApp Business numbers directly from your application — without any Meta Business Manager knowledge. It opens a popup using the Facebook JavaScript SDK, guides the user through authorization, and returns an authorization code.

Muchaw DEV handles the entire backend provisioning process. Your end-user never knows Muchaw DEV exists.

Flow overview

Your Frontend Muchaw DEV Meta Cloud API
│ │ │
│ GET /init │ │
│────────────────────▶│ │
│ { app_id, config_id } │
│◀────────────────────│ │
│ │ │
│ FB.login(app_id, config_id) │
│──────────────────────────────────────────▶ │
│ (user completes popup) │
│◀──────────────────────────────────────── code│
│ │ │
│ POST /complete │ │
│ { code } │ │
│────────────────────▶│ │
│ │ Register, configure │
│ │──────────────────────▶│
│ { number_id, status: "PENDING" } │
│◀────────────────────│ │
│ │ │
│ [webhook: number.activated fires] │

Integration steps

1. Fetch SDK config

1const res = await fetch("https://dev.muchau.com.br/api/embedded-signup/init", {
2 headers: { Authorization: `Bearer ${apiKey}` },
3});
4const { app_id, config_id } = await res.json();

2. Load Facebook SDK and trigger login

1<script>
2 window.fbAsyncInit = function() {
3 FB.init({ appId: app_id, version: "v21.0" });
4 };
5</script>
6<script async src="https://connect.facebook.net/en_US/sdk.js"></script>
1FB.login(
2 (response) => {
3 if (response.authResponse?.code) {
4 completeSignup(response.authResponse.code);
5 }
6 },
7 {
8 config_id: config_id,
9 response_type: "code",
10 override_default_response_type: true,
11 }
12);

3. Complete the signup

1async function completeSignup(code) {
2 const res = await fetch("https://dev.muchau.com.br/api/embedded-signup/complete", {
3 method: "POST",
4 headers: {
5 Authorization: `Bearer ${apiKey}`,
6 "Content-Type": "application/json",
7 },
8 body: JSON.stringify({ code }),
9 });
10 const { number_id, status } = await res.json();
11 // Status is "PENDING" — wait for the number.activated webhook
12}

4. Wait for activation

Configure a webhook for number.activated to know when the number is ready:

1{
2 "event": "number.activated",
3 "data": {
4 "id": "clxyz123...",
5 "displayNumber": "+55 11 99999-0000",
6 "status": "ACTIVE"
7 }
8}

White-label

The entire Embedded Signup flow uses Muchaw DEV’s Meta App and Business Portfolio internally. Your end-user sees only standard Facebook UI — there is no mention of Muchaw DEV. You can customize the experience by embedding it inside your own product UI.

Requirements

  • Your frontend must be served over HTTPS (Facebook requires this)
  • The domain must be added to the Muchaw DEV allowed domains list (contact support)