- Notifications
You must be signed in to change notification settings - Fork6
Wapi.js is a node SDK built for developing WhatsApp Business platform apps with ease and faster
License
wapikit/wapi.js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Visit the documentation of the SDKhere
Beta Version - This SDK is not stable right now. It is currently in beta version. Report issueshere.
Wapi.js is a JavaScript module, written in TypeScript, designed to interact with the WhatsApp cloud API in a user-friendly manner.
- @wapijs/wapi.js: Interact with WhatsApp cloud API with simple and easy-to-manage code.
- @wapijs/create-wapi-app: Start with the development of your WhatsApp bot using this starter template utility.
- Object-Oriented Architecture
- Single Client Model
- Send Messages with the least configuration
- Event Listener for Notifications (support both User and System Notifications)
- Upload Media to WhatsApp servers
- Reply and React to incoming messages.
Ensure you have the Node.js 18 LTS version to use this SDK.
npm install @wapijs/wapi.jsyarn add @wapijs/wapi.jspnpm install @wapijs/wapi.js
Note: This SDK is not affiliated with the official WhatsApp Cloud API or does not act as any official solution provided the the Meta Inclusive Private Limited, this is just a open source SDK built for developers to support them in building whatsapp cloud api based chat bots easily.
- Kickstart your first WhatsApp application with Wapi.js. Check theUser Manual.
- You can check out the example WhatsApp bot here.Example Chatbot
- You can get started with the development of your bot with this starter template utility.
pnpm create-wapi-app
import{Client,TextMessage}from'wapi.js'constwhatsappClient=newClient({apiAccessToken:process.env.WHATSAPP_API_ACCESS_TOKEN,businessAccountId:process.env.WHATSAPP_BUSINESS_ACCOUNT_ID,phoneNumberId:process.env.WHATSAPP_PHONE_NUMBER_ID,port:8080,webhookEndpoint:'/webhook',webhookSecret:process.env.WHATSAPP_WEBHOOK_SECRET})awaitwhatsappClient.message.send({message:newTextMessage({text:'hiii, this is wapijs SDK'}),phoneNumber:'XXXXXXXXXX'})whatsappClient.on('TextMessage',(message)=>{console.log(message)})whatsappClient.on('TextMessage',async(message)=>{message.reply({message:newTextMessage({text:'hiii, this is wapijs SDK'}),,})})whatsappClient.initiate()
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
For detailed guidelines, checkContributing.md.
Distributed under the Apache 2.0 License. ViewLICENSE.
Note: This SDK is part of an open-source product-building initiative bySoftlancer, and this repository will soon be moved under the same organization.
About
Wapi.js is a node SDK built for developing WhatsApp Business platform apps with ease and faster