An opinionated Slack API library with full TypeScript support.
NOTE: This library is still in active development! Any version update (even patch, sorry) may introduce breaking changes! Use at your own risk!
You can install this package from npm with
npm i slack.ts
# or
bun add slack.tsSample usage:
import { App } from 'slack.ts'
const app = new App({
token: process.env.SLACK_BOT_TOKEN,
receiver: { type: 'socket', appToken: process.env.SLACK_APP_TOKEN! },
})
app.on('message', async (message) => {
if (message.user === process.env.SLACK_USER_ID) return
await message.reply("I'm always listening :eyes:")
})
await app.start()For more examples, see the examples directory and the (in)complete guide.
Claude Code helped with inline documentation in a few files, as well as the HTTP and fetch receivers.