At a glance
- Choose the onboarding experience: send a hosted setup link or embed onboarding in your app with
@kapso/sdk. - Create a setup link for each customer, choosing the connection type and who pays Meta fees.
- Let the customer connect: share the link’s URL, or pass its token to the SDK.
- Confirm the connection and billing through a completion webhook and a funding check if you selected Kapso credits.
Send a setup link
The customer completes onboarding on a page hosted by Kapso. No frontend SDK is needed.- Create a customer setup link. Choose
customer_managedfor direct Meta billing orpartner_managedto use Kapso credits. - Send the returned
urlto the customer or open it from your product. - Confirm the connection and billing after the customer finishes.
Embed in your app
Use@kapso/sdk to open onboarding directly from your product. Your backend creates the same setup link, but passes its token to the browser instead of sharing its URL. Never expose your Kapso API key.
Requirements
- an active Multi-partner Solution with Messages processed by: Kapso
- the browser origin in the setup link’s
allowed_origins - the same HTTPS domain added in Meta’s Facebook Login for Business settings
dedicated or coexistence. Create separate setup links if your product offers both paths.
Install the SDK
Create a setup link on your backend
Keep your Kapso API key on the server. Create one setup link for the customer and specify every browser origin that may launch it.data.token to your frontend. Do not expose your Kapso API key.
Connect from the browser
Configure the setup path
The setup link controls the customer experience:allowed_connection_types: ["dedicated"]— API-only WhatsApp numberallowed_connection_types: ["coexistence"]— keep using WhatsApp Business Appprovision_phone_number: true— use a Kapso-provided or project-pool numbermeta_billing_mode: "partner_managed"— use Kapso credits for Meta fees
Handle cancellation and errors
Catch SDK initialization failures separately from connection failures. Keepconnect() inside the button’s click handler so the browser allows Meta’s popup.
whatsapp.destroy() if your application removes the onboarding component before setup completes.
Confirm connection and billing
For either onboarding option, use the setup redirect or SDK result for immediate UI feedback. For server-side reliability, subscribe to Kapso project webhooks and listen forwhatsapp.phone_number.created.
If you selected partner_managed, also confirm that managed funding is verified before sending paid messages. A successful WhatsApp connection alone does not confirm funding. Resolve any billing attention state first.
See Detect connection and Webhooks.
You run messaging
If your MPS uses Messages processed by: Your infrastructure, follow Your infrastructure. That path uses Meta’s SDK, not@kapso/sdk.
