Building your application
Initiating the Wapi.js SDK
Wapi.js SDK provides a single client utility per phone number basis, this means you can create a client with your Whatsapp Business Account regisytered phone numnber and you whatsapp business account id.
Creating a client
To create a client, you need to provide the following details:
- Phone number: The phone number of the whatsapp business account
- Whatsapp Business Account ID: The whatsapp business account id of the whatsapp business account
- Whatsapp Business Account Token: The whatsapp business account token of the whatsapp business account
Now, to get the above details do checkout our guide on how to setup the whatsapp api to start building your application here
Initiating the client
To initiate the client, you need to call the initiate
method on the client instance. This method ensures that your webhook server is up and running and listening to the incoming event from the whatsapp business platform.
This method must be called at the very end of the application flow logic, which ensures that all the event listeners the application intend to listen to must be attached before initiating the client.
Was this page helpful?