Beta Version - This library is not stable right now. It is currently in beta version. Report issues here.
Wapi.js is a JavaScript module, written in TypeScript, designed to interact with the WhatsApp cloud API in a user-friendly manner.
- 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.
This assumes you already have a working Go environment, if not please see this page first.
go get
will always pull the latest tagged release from the master branch.
go get github.com/sarthakjdev/wapi.go
Note: This library 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 library built for developers to support them in building whatsapp cloud api based chat bots easily.
You can check out the example WhatsApp bot here. Example Chatbot
Import the package into your project. This repository has three packages exported:
- github.com/sarthakjdev/wapi.go/components
- github.com/sarthakjdev/wapi.go/wapi/wapi
- github.com/sarthakjdev/wapi.go/wapi/events
import "github.com/sarthakjdev/wapi.go/wapi/wapi"
Construct a new Wapi Client to access the managers in order to send messages and listen to incoming notifications.
whatsappClient, err := wapi.New(wapi.ClientConfig{
PhoneNumberId: "",
ApiAccessToken: "",
BusinessAccountId: "",
WebhookPath: "/webhook",
WebhookSecret: "",
WebhookServerPort: 8080,
})
-
Message Structures: Refer to the WhatsApp Docs here.
-
Notification Payloads: Details can be found here.
- 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, check Contributing.md.
Distributed under the Apache 2.0 License. View LICENSE.
- Sarthak Jain
- Email: sarthak@softlancer.co
- Twitter | LinkedIn
Note: This library is part of an open-source product-building initiative by Softlancer, and this repository will soon be moved under the same organization.