Installation and Preparations
Setting up Wapi.js Application Development Environment
Initiating a Wapi.js project
Chat bot
The first step to build a wapi.js based chat bot is to create a new node.js project. You can quickly setup a new project using the utility NPM package provided with the wapi.js SDK only, run the following command in your terminal to setup the project:
pnpm create-wapi-app my-whatsapp-bot
Once you run this command, you would be asked a couple of questions like the name of the project and whether you want to use typescript or javascript for this project. Once you answer them, you project will start to setup and once done. You can navigate to the project directory and start building your chat bot.
Other use cases
- You are a developer and want to integrate the whatsapp business API with your existing backend.
- You are a solution partner or a tech partner with WhatsApp and want to access the WhatsApp business API to build a solution for your clients.
To do so, you can install the wapi.js SDK using the following command:
pnpm add @wapijs/wapi.js
You may also consider the following best pratices of developing a Node.js Application:
- Setting up a Linter.
- Setting up a formatter.
- Setting up proper scripts in package.json.
- Using a version control system like Git and setting up workflows for Github Actions for sanity build and lint checks.
- Using consistent naming conventions.
- Using environment variables for sensitive information.
Process to building the application docs, for further assistance.
Was this page helpful?