Using Connect Button
This page describes how to use the 360Dialog Connect Button React package to trigger Integrated Onboarding
The 360Dialog Connect Button is a React Node.js package that simplifies Integrated Onboarding (IO). The button is customizable and, when clicked, triggers the Integrated Onboarding flow. It also simplifies handling the post-IO-flow redirect.
Partners using a different UI library or framework, or preferring their own implementation, can create their own Integrated Onboarding trigger and redirect consumer by following this guide.
The following demo/generator site can be used to practice consuming IO redirects:
Requirements
Direct-Paid Accounts
Clients of Direct-Paid partner accounts will see a price detail and payment information page between the Account Creation and Embedded Signup steps.
The client needs to grant API key permission before the partner can generate an API key for them. Clients can give this permission during the Integrated Onboarding flow (pictured below), or in the 360Dialog Hub after onboarding.

Implementation
Install Package
Install the 360dialog-connect-button package from npm:
We recommend reading the package's description on npm to view a full list of the component's props.
Add Button Component
With / Without IO Signature
The button can be configured to use IO Signature, a new optional security feature that prevents clients from onboarding phone numbers without authorization from the partner/partner platform.
It requires a server-side implementation, and IO Signature must be enabled in the 360Dialog Hub. See implementation instructions here.
Partners preferring a quicker start can use the 360Dialog Connect Button without using the IO Signature feature.
Code examples for both approaches (with and without IO Signature) are shown below.
Import the ConnectButton component from the 360dialog-connect-button package.
Implement the component like in the example below.
Import the ConnectButton component from the 360dialog-connect-button package.
Implement the component with io_signature, io_timestamp props and a fetchIoSignature function on the frontend.
The code example below expects a REST endpoint on the server-side, as shown in the implementation guide here.
Signature invalidation not covered
An IO Signature becomes invalid:
after 24 hours,
or when it has been used once to start IO.
When an IO signature is invalidated, a new one must be acquired from the server before the user can make another IO attempt.
The example below does not cover signature invalidation.
Consume Redirect
After completing onboarding, clients are redirected to the partner's configured redirect URL. The following query parameters are added to the redirect URL:
client=<client-id>
CallbackObject.client
ID of the client who was redirected to the partner's redirect URL.
channels=[<channel-id>,<channel-id>]
CallbackObject.channels
Comma-separated array of channel IDs (a.k.a. phone numbers) the partner has permission to generate an API key for
revoked=[<channel-id>]
CallbackObject.revokedChannels
OPTIONAL - may not be present in every redirect.
Comma-separated array of channel IDs (a.k.a. phone numbers) the client has revoked partner's API key permissions for
The 360Dialog Connect Button simplifies these queries' parsing and handling if it is present/mounted in the partner's configured redirect URL. The function passed in the component's callback property is called after the client is redirected from Integrated Onboarding to the partner's redirect URL page.
If the 360Dialog Connect Button is present and mounted in the redirect URL page, proceed to the next step.
If it is not possible to mount the component on the redirect URL page, use the following JS code in the redirect URL page to replicate the 360Dialog Connect Button's handling behavior:
Handle Webhooks
After completing onboarding, the partner's webhook URL endpoint will receive the following important status events:
channel_created: Sent when a new WhatsApp channel is createdchannel_status_running: Sent when the channel status changesphone_number_quality_changed: Sent when the messaging limit changes
Generate API Key
When the channel reaches running status, create an API key for the newly-onboarded phone number to begin sending messages with this phone number.
Store the returned API key securely - it cannot be retrieved later.
Reminder for Direct-Paid partners
Partners on the Direct-Paid billing plan must receive API key permission from their client before being allowed to generate an API key for the client's phone number.
Clients are asked during onboarding if they want to grant API key permission. They can also grant API key permission later in the 360Dialog Hub.
See Partner Permissions for details.
Last updated
Was this helpful?