> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gateway.connexease.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> How the Embedded Signup SDK works — the publishable/secret key model, the onboarding flow, and prerequisites.

Embed Meta WhatsApp Business (Cloud API & Coexistence) onboarding directly into your product — no redirects, no iframes. The SDK renders the entire flow as isolated Shadow-DOM modals on top of your page.

**Package:** `@connexease/gateway-embedded-signup` · **Version:** 1.0.2

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/public-embedded-signup-sdk/installation">
    Install via npm or drop in the CDN script.
  </Card>

  <Card title="Quickstart" icon="bolt" href="/public-embedded-signup-sdk/quickstart">
    Render the connect button in a few lines.
  </Card>

  <Card title="Backend Integration" icon="server" href="/public-embedded-signup-sdk/backend-integration">
    The session-token endpoint your server exposes.
  </Card>
</CardGroup>

## How It Works

The SDK follows the **Stripe Connect pattern**: a **publishable key** lives in the browser, a **secret key** stays on your server, and a short-lived **session token** bridges the two. Connexease gives you both keys from the dashboard.

```text theme={null}
1 -)  init(publishableKey)     The SDK initializes in the browser.

2 -) user clicks → launch()   Your button handler starts the flow.

3 -) WhatsApp signup          The SDK opens the Meta WhatsApp Embedded Signup
                            popup and completes the connection for you.

4 -) onSuccess(result)        You receive the connected WhatsApp account details.
```

**Step by step:**

1. **Initialize** — call `init()` once with your **publishable key**.
2. **Launch** — the user clicks your button → you call `launch()`.
3. **WhatsApp signup** — the SDK runs the Meta WhatsApp Embedded Signup popup and handles the whole connection.
4. **Done** — the SDK fires `onSuccess` with the connected account details.

Your only jobs are to **expose a session-token endpoint on your backend** and **handle the callbacks**. The SDK takes care of the Meta popup, OAuth, and the connection for you.

## Prerequisites

1. A **publishable key** (`pb_…`) from the Connexease dashboard — safe to ship in the browser.
2. A **secret key** (`sk_…`) stored securely on your server — **never** in the browser.
3. Your site's **origin** added to the allowed-origins list in the Connexease dashboard — otherwise the flow is rejected because the origin isn't allowed.
