Skip to main content
The popup flow allows platform developers to embed WhatsApp account connection directly in their applications using Meta’s FB.login() popup. This provides a seamless in-app experience without full-page redirects.
This guide is for platform developers building applications on top of Chirp. If you just want to connect your own WhatsApp Business Account, use the dashboard method.

When to Use This Flow

Choose the popup flow when:
  • You want a seamless, in-app signup experience
  • You’re building a single-page application (SPA)
  • You need fine-grained control over the signup process
  • You want to track signup attempts with custom metadata
  • You’re building a multi-tenant platform where multiple end-users connect their accounts
For a simpler server-side redirect pattern, see the Redirect Flow.

How It Works

  1. Start Attempt - Create a tracking record with optional metadata
  2. Launch Popup - Open Meta’s Embedded Signup using FB.login()
  3. Handle Events - Process FINISH, CANCEL, or ERROR events from Meta
  4. Mark Interrupted - If the user completes signup, associate the WABA ID
  5. Claim Profile - Create the WhatsApp Business Profile from a recovered attempt

Starting a Signup Attempt

Before launching the Meta Embedded Signup popup, create a tracking record:
Response:
Attempt Response
The metadata field is optional but recommended for platforms with multiple end-users. Store your internal identifiers to later identify which user each recovered signup belongs to.

Metadata Use Cases

Use metadata to store any information that helps you identify your users:

Launching the Meta Popup

After creating the attempt, launch Meta’s Embedded Signup using the Facebook SDK:
Launch Embedded Signup Popup

Handling Meta Events

Meta’s Embedded Signup fires different events based on user actions:

FINISH Event

The user successfully completed the signup flow:
Handle FINISH Event

CANCEL Event

The user closed the popup without completing:
Handle CANCEL Event

ERROR Event

Meta encountered an error during signup:
Handle ERROR Event

Marking an Interrupted Signup

When a user completes the Meta signup but something prevents the normal flow from completing (network error, browser tab closed, etc.), use the mark-interrupted endpoint to associate the WABA ID with the attempt:
This ensures the attempt can be recovered later even if the callback fails.

Handling Recovered Signups

If a user completes the Meta signup but doesn’t return to your application, the signup is marked for recovery. Query recovered attempts to show a “Continue Setup” UI:
Response:
Recovered Attempts Response

Filtering by Your Users

Use the returned metadata to filter recovered attempts for specific users:
Filter Recovered Attempts

Claiming a Recovered Attempt

When a user is ready to complete their interrupted signup, claim the recovered attempt:
Response:
Claim Response

Cancelling an Attempt

If a user abandons the signup flow before completing it on Meta’s side:
This is optional but helps keep your recovered attempts list clean and provides analytics on where users drop off.

Tracking Meta Errors

If Meta returns an error during the signup flow, track it separately for analytics:

Error Tracking Fields

Distinguishing between user cancellations (cancel-attempt) and Meta errors (fail-attempt) enables better analytics. You can track conversion rates, identify problematic steps, and correlate with Meta support tickets using the errorId.

Complete Integration Example

Here’s a full example using the SDK:
Complete Popup Integration with SDK

Timing and Expiration

Signup attempts expire after 15 minutes. If a user doesn’t complete the Meta flow within this window, they’ll need to start a new signup attempt.

Next Steps

API Reference

Full API documentation for signup attempt tracking

Redirect Flow

Alternative server-side redirect integration