sarthakjdev / wapi.go

Golang SDK to build WhatsApp Business Apps Faster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


@wapijs/wapi.js


πŸ“Œ Status

Beta Version - This library is not stable right now. It is currently in beta version. Report issues here.

πŸ“– About

Wapi.js is a JavaScript module, written in TypeScript, designed to interact with the WhatsApp cloud API in a user-friendly manner.

✨ Features

  • 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.

πŸ’» Installation

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.

πŸš€ Usage

You can check out the example WhatsApp bot here. Example Chatbot

Example Usage

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,
	})

πŸ”— References

  • Message Structures: Refer to the WhatsApp Docs here.

  • Notification Payloads: Details can be found here.

🀝 Contribution Guidelines

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

For detailed guidelines, check Contributing.md.

πŸ“œ License

Distributed under the Apache 2.0 License. View LICENSE.

πŸ“ž Contact

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.

About

Golang SDK to build WhatsApp Business Apps Faster

License:GNU Affero General Public License v3.0


Languages

Language:Go 98.0%Language:Shell 1.4%Language:Makefile 0.6%