{"id":15285594,"url":"https://github.com/codesyncr/adonisjs-whatsapp","last_synced_at":"2025-04-13T02:30:41.175Z","repository":{"id":192044797,"uuid":"686253729","full_name":"CodeSyncr/adonisjs-whatsapp","owner":"CodeSyncr","description":"The \"adonisjs-whatsapp\" plugin is a powerful extension for Adonis JS, designed to seamlessly integrate with the WhatsApp Cloud API. This plugin empowers developers to effortlessly incorporate WhatsApp's cloud-based functionalities into their Adonis JS applications. By simplifying the implementation of WhatsApp's API","archived":false,"fork":false,"pushed_at":"2024-09-24T13:46:27.000Z","size":1560,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-04-09T23:02:04.544Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeSyncr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-02T07:12:33.000Z","updated_at":"2025-04-07T09:38:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"560a2864-1cc8-4dc8-983e-f84641fea219","html_url":"https://github.com/CodeSyncr/adonisjs-whatsapp","commit_stats":null,"previous_names":["codesyncr/adonisjs-whatsapp"],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSyncr%2Fadonisjs-whatsapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSyncr%2Fadonisjs-whatsapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSyncr%2Fadonisjs-whatsapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSyncr%2Fadonisjs-whatsapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeSyncr","download_url":"https://codeload.github.com/CodeSyncr/adonisjs-whatsapp/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657795,"owners_count":21140841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T15:06:33.112Z","updated_at":"2025-04-13T02:30:41.148Z","avatar_url":"https://github.com/CodeSyncr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![adonisjs-whatsapp](https://socialify.git.ci/CodeSyncr/adonisjs-whatsapp/image?description=1\u0026descriptionEditable=Package%20makes%20it%20easy%20for%20adonis%20to%20access%20the%20WhatsApp%20Cloud%20API\u0026forks=1\u0026issues=1\u0026language=1\u0026logo=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F6%2F6b%2FWhatsApp.svg%2F1024px-WhatsApp.svg.png%3F20220228223904\u0026name=1\u0026owner=1\u0026pattern=Circuit%20Board\u0026pulls=1\u0026stargazers=1\u0026theme=Light)\n\n## What's this\n\nThis package makes it easy for developers to access the [WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api) service in the AdonisJS 5 application.\n\n## Getting Started\n\nPlease create and configure your Facebook WhatsApp application by following the [\"Get Started\"](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) section of the official guide.\n\n\u003caside class=\"notice\"\u003e\n  \u003ca href=\"https://github.com/CodeSyncr/adonisjs-whatsapp/tree/1.x\"\u003eFor AdonisJS v5 use 1.x branch\u003c/a\u003e\n\u003c/aside\u003e\n\n## Features\n\n- [x] Multiple whatsapp number setup via database\n- [x] Generic Webhook for handling all numbers request\n- [x] Mark messages as read\n- [x] Upload media to the WhatsApp server\n- [x] Send text messages\n- [x] Send images\n- [x] Send documents\n- [x] Send audios\n- [x] Send videos\n- [x] Send stickers\n- [x] Send locations\n- [x] Send template messages\n- [x] Send contacts\n- [x] Send reply button messages\n- [x] Send list messages\n- [x] Include a Webhook Endpoint\n- [x] Event listener when receiving a webhook\n- [x] Create Template\n- [x] Get Templates\n- [x] Delete Template\n- [ ] Download media from the WhatsApp server\n- [ ] Get Analytics\n- [ ] Get Phone Numbers, Display Name\n- [ ] QR Codes Action\n- [ ] Get Business Account Details \u0026 Extended Credit\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Events](#events)\n- [Changelog](#changelog)\n- [License](#license)\n\n\n## Installation\n\nInstall the package using npm or yarn:\n\n```bash\nnpm i @brighthustle/adonisjs-whatsapp\n# or\nyarn add @brighthustle/adonisjs-whatsapp\n```\n\nThen, configure the package using the configure command:\n\n```bash\nnode ace configure @brighthustle/adonisjs-whatsapp\n```\n\nAfter executing the above command, a `config/whatsapp.ts` file will be created, where you can define the WhatsApp Cloud API.\n\nAn important step is to set environment variables in your `.env` and validate them in the `env.ts` file.\n\n```ts\nWABA_PHONE_ID: Env.schema.string(),\nWABA_ID: Env.schema.string(),\nWABA_TOKEN: Env.schema.string(),\nWABA_VERIFY: Env.schema.string(),\n```\n\n## Usage\n\nTo send text, images, and more, use the same singleton in your preload, controller or service file.\n\n```ts\n// app/controllers/example_controller.ts\n\nimport whatsapp from '@brighthustle/adonisjs-whatsapp/services/main'\nimport type { HttpContext } from '@adonisjs/core/http'\n\nexport default class ExampleController {\n  public async example(ctx: HttpContext) {\n    await whatsapp.sendText(0000000000, 'Lorem ipsum dolor sit amet.', {}, 1)\n  }\n}\n```\n\n### Note\nThe last parameter, in this case, 1, is required when the configuration provider is set to `lucid`. It represents the data ID and is used to associate the message with a specific context when using the Lucid database provider.\n\nMake sure to fetch the parameters from `database` according to your specific use case and configuration.\n\n## Events\n\nThe package supports events that are triggered when receiving a webhook from WhatsApp, some of which can be seen [here](./adonis-typings/events.ts).\n\nThe event can be subscribed to via the start/whatsapp.ts file. It have phoneNumberId which can be used to identify the message is sent for which user.\n\nTo handle incoming WhatsApp messages in your AdonisJS application, you can subscribe to the `message:text` and other event using the `start/whatsapp.ts` file. This event provides a `WhatsAppMessageContract` object, which contains information about the incoming message.\n\n```ts\n// start/whatsapp.ts\n\nimport whatsapp from '@brighthustle/adonisjs-whatsapp/services/main'\nimport { WhatsAppMessageContract } from '@brighthustle/adonisjs-whatsapp/types'\n\nwhatsapp.on('message:text', function (message: WhatsAppMessageContract) {\n  // TODO: do whatever you want\n\n  // Example: Identify the user by phoneNumberId\n  const userPhoneNumberId = message.phoneNumberId;\n  console.log(`Received a text message for user with phoneNumberId: ${userPhoneNumberId}`);\n  // TODO: Add your custom logic to handle the message\n})\n```\n\n## Changelog\n\nPlease see the [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](./LICENSE.md) file for more information.\n\n## Disclaimer\n\nThis package is not officially maintained by Facebook. WhatsApp and Facebook trademarks and logos are the property of Meta Platforms, Inc.\n\n### NOTICE\n\nThis package is modified from the original package https://github.com//adonisjs-whatsapp Written By : sooluh","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyncr%2Fadonisjs-whatsapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesyncr%2Fadonisjs-whatsapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesyncr%2Fadonisjs-whatsapp/lists"}