Template

Slack app (Node.js, Bolt)

Slash command, threaded replies to mentions and an App Home tab, in Socket Mode or HTTP mode with signature verification.

Download ZIP (5.2 KB)

SHA-256: bcdfdf96d39ea65838f6a5800ffd2c60f1772f31b9d822b1f303b20451db720a (checksum file)

Stack: Node.js 20+, @slack/bolt 4 · License: MIT · Files: 10

What it includes

Slash command, threaded replies to mentions and an App Home tab, in Socket Mode or HTTP mode with signature verification.

File tree

slack-bolt-node/
├── src/
│   ├── app.js
│   └── logic.js
├── tests/
│   └── logic.test.js
├── .dockerignore
├── .env.example
├── .gitignore
├── Dockerfile
├── LICENSE
├── package.json
└── README.md

Setup

unzip slack-bolt-node.zip && cd slack-bolt-node
npm install
cp .env.example .env
npm run dev
npm test

Fill in .env with credentials from the platform's official developer console. Never commit it: the included .gitignore excludes it.

Step-by-step guide

  1. Download the ZIP above, check its SHA-256 and unzip it.
  2. At api.slack.com/apps create an app, add the bot scopes commands, app_mentions:read and chat:write, install it and copy the Bot User OAuth Token into SLACK_BOT_TOKEN and the Signing Secret into SLACK_SIGNING_SECRET.
  3. Copy .env.example to .env (or .dev.vars for Workers) and paste the values. Never commit it.
  4. Install dependencies and run the tests: they pass without network access.
  5. Run it locally with the commands in the Setup section and send your bot a message.
  6. Push the folder to a private GitHub repository so a host can build it.

Deploy on Railway

  1. Press Deploy on Railway below and sign in (it opens a new Railway project).
  2. Choose Deploy from GitHub repo and pick your repository. Railway detects the included Dockerfile.
  3. Open Variables and add: SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET (HTTP mode) or SLACK_APP_TOKEN (Socket Mode), PORT=3000.
  4. In Settings → Networking generate a public domain so the platform can reach your webhook at https://<domain>/slack/events.
  5. Watch the deploy logs until the bot reports it is running, then test it. Set a usage limit in your Railway workspace settings.

Deploy on Railway

Affiliate link (referral code 8Mexkc): BotNetwork may earn a commission at no extra cost to you. The button opens Railway's new-project page; this template is not a published one-click Railway template, so you connect your own repository. Railway bills by usage: check its pricing page.

Next steps

Run with Docker

docker build -t slack-bolt-node .
docker run --rm --env-file .env slack-bolt-node

Official documentation

https://tools.slack.dev/bolt-js/

All templates