{"id":17655953,"url":"https://github.com/sagi/workers-slack","last_synced_at":"2025-08-13T03:14:34.611Z","repository":{"id":41786438,"uuid":"194277217","full_name":"sagi/workers-slack","owner":"sagi","description":"Slack API for Cloudflare Workers","archived":false,"fork":false,"pushed_at":"2024-07-05T05:51:11.000Z","size":1250,"stargazers_count":28,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T03:56:08.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sagi.io","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/sagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2019-06-28T13:19:36.000Z","updated_at":"2025-07-22T14:10:49.000Z","dependencies_parsed_at":"2025-04-13T09:33:03.846Z","dependency_job_id":"9a2c11d5-eea8-478e-af6b-04f1702c3224","html_url":"https://github.com/sagi/workers-slack","commit_stats":{"total_commits":118,"total_committers":5,"mean_commits":23.6,"dds":0.4491525423728814,"last_synced_commit":"791393f0d7dbe27fb147532e099170682e806fc6"},"previous_names":["sagi/cfw-slack"],"tags_count":39,"template":false,"template_full_name":null,"purl":"pkg:github/sagi/workers-slack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagi%2Fworkers-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagi%2Fworkers-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagi%2Fworkers-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagi%2Fworkers-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sagi","download_url":"https://codeload.github.com/sagi/workers-slack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sagi%2Fworkers-slack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269987123,"owners_count":24508176,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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-10-23T13:09:17.053Z","updated_at":"2025-08-13T03:14:34.530Z","avatar_url":"https://github.com/sagi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# workers-slack\n\n[`@sagi.io/workers-slack`](https://www.npmjs.com/package/@sagi.io/workers-slack) allows\nyou to use Slack's Web API within Cloudflare Workers.\n\n⭐ We use it at **[OpenSay](https://opensay.co/?s=workers-slack)** to access Slack's REST API through Cloudflare Workers.\n\nHere is a [blog post](https://sagi.io/slack-api-for-cloudflare-workers/) that explains why I built it.\n\n\n[![CircleCI](https://circleci.com/gh/sagi/workers-slack.svg?style=svg\u0026circle-token=e5282bece02d965a8fcde66d517bb599f20aa2e4)](https://circleci.com/gh/sagi/workers-slack)\n[![MIT License](https://img.shields.io/npm/l/@sagi.io/workers-slack.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n[![version](https://img.shields.io/npm/v/@sagi.io/workers-slack.svg?style=flat-square)](http://npm.im/@sagi.io/workers-slack)\n\n## Installation\n\n~~~\n$ npm i @sagi.io/workers-slack\n~~~\n\n## Cloudflare Workers Usage\n\nIf you use Cloudflare's Wrangler you must set the [`node_compat`](https://developers.cloudflare.com/workers/wrangler/configuration/#inheritable-keys) flag in your `wrangler.toml` - the reason for this is that this library is built both for Cloudflare Workers and Node.js (for which we need `globals`).\n\nInitialize `SlackREST`:\n\n~~~js\n\n// Without token:\nconst SlackREST = require('@sagi.io/workers-slack')\nconst SlackAPI = new SlackREST()\n\n// With token:\nconst botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;\nconst SlackREST = require('@sagi.io/workers-slack')\nconst SlackAPI = new SlackREST({ botAccessToken })\n~~~\n\nYou can then use supported [Slack methods](https://api.slack.com/methods).\nFor instance, here's how to use the [`chat.postMessage`](https://api.slack.com/methods/chat.postMessage) method:\n\n~~~js\n\n// SlackREST was initialized with a token\nconst formData = { channel: 'general', text: 'hello world'}\n\n// SlackREST wasn't initialized with a token\nconst botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;\nconst formData = { token: botAcccessToken, channel: 'general', text: 'hello world' }\n\nconst result = await SlackREST.chat.postMessage(formData)\n~~~\n\n### Verifying requests from Slack\n\nMore information [here](https://api.slack.com/authentication/verifying-requests-from-slack).\n\nThe `SlackREST.helpers.verifyRequestSignature` method returns `true` when a signature from Slack is verified. Otherwise it throws an error.\n\n~~~js\nconst SlackREST = require('@sagi.io/workers-slack')\nconst SlackAPI = new SlackREST()\n\nconst signingSecret = process.env.SLACK_SIGNING_SECRET\nconst isVerifiedRequest = await SlackAPI.helpers.verifyRequestSignature(request, signingSecret)\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagi%2Fworkers-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsagi%2Fworkers-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsagi%2Fworkers-slack/lists"}