
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@cfanoulis/workers-slack
Advanced tools
private fork for testing, please use the original (@sagi.io/workers-slack)
@sagi.io/workers-slack
allows
you to use Slack's Web API within Cloudflare Workers.
⭐ We use it at OpenSay to access Slack's REST API through Cloudflare Workers.
Here is a blog post that explains why I built it.
$ npm i @sagi.io/workers-slack
Initialize SlackREST
:
// Without token:
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST()
// With token:
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST({ botAccessToken })
You can then use supported Slack methods.
For instance, here's how to use the chat.postMessage
method:
// SlackREST was initialized with a token
const formData = { channel: 'general', text: 'hello world'}
// SlackREST wasn't initialized with a token
const botAccessToken = process.env.SLACK_BOT_ACCESS_TOKEN;
const formData = { token: botAcccessToken, channel: 'general', text: 'hello world' }
const result = await SlackREST.chat.postMessage(formData)
More information here.
The SlackREST.helpers.verifyRequestSignature
method returns true
when a signature from Slack is verified. Otherwise it throws an error.
const SlackREST = require('@sagi.io/workers-slack')
const SlackAPI = new SlackREST()
const signingSecret = process.env.SLACK_SIGNING_SECRET
const isVerifiedRequest = await SlackAPI.helpers.verifyRequestSignature(request, signingSecret)
FAQs
private fork for testing, please use the original (@sagi.io/workers-slack)
The npm package @cfanoulis/workers-slack receives a total of 0 weekly downloads. As such, @cfanoulis/workers-slack popularity was classified as not popular.
We found that @cfanoulis/workers-slack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.