{"id":14987147,"url":"https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api","last_synced_at":"2025-04-11T23:22:16.727Z","repository":{"id":61708020,"uuid":"552452195","full_name":"monkeymars/medusa-plugin-whatsapp-cloud-api","owner":"monkeymars","description":"Plugin to integrate WhatsApp Cloud API on MedusaJS","archived":false,"fork":false,"pushed_at":"2022-11-13T17:07:43.000Z","size":1222,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-26T04:43:43.921Z","etag":null,"topics":["ecommerce","hacktoberfest","medusa-hackathon","medusajs","plugin","whatsapp","whatsapp-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monkeymars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-16T16:20:36.000Z","updated_at":"2024-03-20T07:39:33.000Z","dependencies_parsed_at":"2022-10-20T08:45:32.276Z","dependency_job_id":null,"html_url":"https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeymars%2Fmedusa-plugin-whatsapp-cloud-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeymars%2Fmedusa-plugin-whatsapp-cloud-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeymars%2Fmedusa-plugin-whatsapp-cloud-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkeymars%2Fmedusa-plugin-whatsapp-cloud-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkeymars","download_url":"https://codeload.github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493175,"owners_count":21113207,"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":["ecommerce","hacktoberfest","medusa-hackathon","medusajs","plugin","whatsapp","whatsapp-api"],"created_at":"2024-09-24T14:14:10.298Z","updated_at":"2025-04-11T23:22:16.691Z","avatar_url":"https://github.com/monkeymars.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## medusa-plugin-whatsapp-cloud-api\n\n![dots-cover-template-min](https://user-images.githubusercontent.com/2216426/198864470-a145383d-1b29-454f-bd3d-11191977b270.jpeg)\n\nWhatsApp Cloud API / Messaging plugin.\n\nLearn more about how you can use this plugin in the [documentaion](https://docs.medusajs.com/advanced/backend/plugins/overview/).\n\n[![Build \u0026 Test](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/node-ci.yml/badge.svg?branch=main)](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/node-ci.yml)\n[![npm publish](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/npm-publish.yml)\n\u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/dw/medusa-plugin-whatsapp-cloud-api\"\u003e\n[![CodeQL](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/codeql.yml/badge.svg)](https://github.com/monkeymars/medusa-plugin-whatsapp-cloud-api/actions/workflows/codeql.yml)\n\u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/l/medusa-plugin-whatsapp-cloud-api\"\u003e\n\u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/medusa-plugin-whatsapp-cloud-api\"\u003e\n\n## Install Plugin\n\nIn the directory of your Medusa server, run the following command to install WhatsApp Cloud API plugin:\n\n#### Yarn or NPM\n\n```bash\nnpm install --save medusa-plugin-whatsapp-cloud-api\n```\n\n```bash\nyarn add medusa-plugin-whatsapp-cloud-api\n```\n\n## Options\n\nNext, you need to add configurations for **medusa-plugin-whatsapp-cloud-api** plugin.\nIn **medusa-config.js** add the following at the plugins array:\n\n```js\nconst plugins = [\n  {\n    resolve: `medusa-plugin-whatsapp-cloud-api`,\n    options: {\n      accessToken: \"\u003cTemporary or permanent access token\u003e\",\n      WABA_ID: \"\u003cWhatsApp Business Account ID\u003e\",\n      senderPhoneNumberId: \"\u003cPhone number ID\u003e\",\n      graphAPIVersion: \"\u003cGraph API Version\u003e\",\n    },\n  },\n];\n```\n\n## Dynamic usage\n\nYou can resolve the WhatsApp service to dynamically send messages via WhatsApp Cloud API. Example:\n\n#### sendMessageTemplate\n\n```js\nrouter.get(\"/send-message-sample\", async (req, res) =\u003e {\n  const whatsappService = req.scope.resolve(\"whatsappService\");\n\n  const response = await whatsappService.sendMessageTemplate({\n    templateId: \"flight_confirmation\", // your message templates\n    recipientPhone: \"+6281556750222\",\n    headerMessage: [\n      {\n        type: \"image\",\n        image: {\n          link: \"https://\u003cURL\u003e\",\n        },\n      },\n    ],\n    contentMessage: [\n      { type: \"text\", text: \"NYC\" },\n      { type: \"text\", text: \"JFK\" },\n      {\n        type: \"date_time\",\n        date_time: {\n          fallback_value: \"December 24, 2022\",\n        },\n      },\n    ],\n    lang: \"en_US\",\n  });\n\n  res.json({\n    message: `message sent: ${response.status}`,\n  });\n});\n```\n\n#### sendLocation\n\n```js\nwhatsappService.sendLocation({\n  name: \"GBK Stadium\",\n  address: \"Jl. Pintu Satu Senayan, Gelora, Kota Jakarta Pusat, DKI Jakarta\",\n  recipientPhone: \"+6281556750222\",\n  latitude: -6.21844,\n  longitude: 106.8018,\n});\n```\n\n## Preview: sendMessageTemplate\n\n![sample](https://user-images.githubusercontent.com/2216426/197109119-3ad748b9-803c-45b8-888d-8f5cd8bada06.jpeg)\n\n# Contributing\n\nWhen contributing to this repository, please first discuss the change you wish to make via issue,\nemail, or any other method with the owners of this repository before making a change.\n\nPlease note we have a code of conduct, please follow it in all your interactions with the project.\n\n## Pull Request Process\n\n1. Ensure any install or build dependencies are removed before the end of the layer when doing a\n   build.\n2. Update the README.md with details of changes to the interface, this includes new environment\n   variables, exposed ports, useful file locations and container parameters.\n3. Increase the version numbers in any examples files and the README.md to the new version that this\n   Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).\n4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you\n   do not have permission to do that, you may request the second reviewer to merge it for you.\n\n## Resources\n\n- [Overview of plugins in Medusa](https://docs.medusajs.com/advanced/backend/plugins/overview)\n- [Create Message Templates for WhatsApp Business Account](https://business.facebook.com/business/help/2055875911147364?id=2129163877102343)\n- [WhatsApp Cloud API Messages References](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages)\n- [Create Plugin](https://docs.medusajs.com/advanced/backend/plugins/create)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeymars%2Fmedusa-plugin-whatsapp-cloud-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkeymars%2Fmedusa-plugin-whatsapp-cloud-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkeymars%2Fmedusa-plugin-whatsapp-cloud-api/lists"}