{"id":19646166,"url":"https://github.com/yoctol/messenger-batch","last_synced_at":"2026-06-13T17:04:33.564Z","repository":{"id":49009950,"uuid":"121959479","full_name":"Yoctol/messenger-batch","owner":"Yoctol","description":"Gracefully batching messenger requests.","archived":false,"fork":false,"pushed_at":"2021-07-01T05:31:24.000Z","size":466,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-27T00:16:11.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Yoctol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-18T14:33:44.000Z","updated_at":"2021-07-01T05:30:26.000Z","dependencies_parsed_at":"2022-08-28T00:00:34.944Z","dependency_job_id":null,"html_url":"https://github.com/Yoctol/messenger-batch","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Yoctol/messenger-batch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoctol%2Fmessenger-batch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoctol%2Fmessenger-batch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoctol%2Fmessenger-batch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoctol%2Fmessenger-batch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yoctol","download_url":"https://codeload.github.com/Yoctol/messenger-batch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yoctol%2Fmessenger-batch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34292326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-11T14:37:09.865Z","updated_at":"2026-06-13T17:04:33.549Z","avatar_url":"https://github.com/Yoctol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# messenger-batch\n\n[![npm](https://img.shields.io/npm/v/messenger-batch.svg?style=flat-square)](https://www.npmjs.com/package/messenger-batch)\n[![Build Status](https://travis-ci.org/Yoctol/messenger-batch.svg?branch=master)](https://travis-ci.org/Yoctol/messenger-batch)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n\u003e Gracefully batching messenger requests.\n\n## Installation\n\n```sh\nnpm install messenger-batch\n```\n\nThis module is based on the approach described in [Making Batch Requests](https://developers.facebook.com/docs/graph-api/making-multiple-requests/).\n\n## Usage\n\n```js\nconst { MessengerClient, MessengerBatch } = require('messaging-api-messenger');\nconst { MessengerBatchQueue } = require('messenger-batch');\n\nconst client = MessengerClient.connect({\n  accessToken: ACCESS_TOKEN,\n});\n\nconst queue = new MessengerBatchQueue(client);\n\n(async () =\u003e {\n  await queue.push(\n    MessengerBatch.sendText('psid', 'hello!');\n  );\n\n  await queue.push(\n    MessengerBatch.sendMessage('psid', {\n      attachment: {\n        type: 'image',\n        payload: {\n          url:\n            'https://cdn.free.com.tw/blog/wp-content/uploads/2014/08/Placekitten480-g.jpg',\n        },\n      },\n    })\n  );\n\n  const profile = await queue.push(MessengerBatch.getUserProfile('psid'));\n\n\n  console.log(profile);\n\n  queue.stop();\n})();\n```\n\nRetry for error: `(#613) Calls to this api have exceeded the rate limit.`.\n\n```js\nconst { MessengerBatchQueue, isError613 } = require('messenger-batch');\n\nconst queue = new MessengerBatchQueue(client, {\n  shouldRetry: isError613,\n  retryTimes: 2,\n});\n```\n\n## Options\n\n### delay\n\nDefault: `1000`.\n\n### retryTimes\n\nDefault: `0`.\n\n### shouldRetry\n\nDefault: `() =\u003e true`.\n\n## License\n\nMIT © [Yoctol](https://github.com/Yoctol/messenger-batch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoctol%2Fmessenger-batch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoctol%2Fmessenger-batch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoctol%2Fmessenger-batch/lists"}