A NestJS application that installs into Slack, accepts /stamp :emoji: slash commands,
and posts a larger version of that emoji back into the channel.
- Slack OAuth install flow with workspace-scoped bot token storage
- Signed slash command endpoint with immediate acknowledgement
- Friendly onboarding page at
/with the exact URLs Slack needs - PostgreSQL persistence via TypeORM migrations
- Node.js 20.19+, 22.13+, or 24+
- Docker Desktop or a local PostgreSQL instance
- A Slack workspace where you can create apps
- Clone the repository and install the supported Node version:
nvm install
nvm use
npm install- Start PostgreSQL:
npm run db:start
npm run migration:run- Copy the environment file:
cp .env.example .env- Start the app:
npm run start:dev- Open
http://localhost:3000. The landing page shows:- the OAuth redirect URL
- the slash command request URL
- the bot and user scopes you need
- whether your current
.envis complete
Slack cannot call localhost directly. For local development:
- Start the app with
npm run start:dev. - Expose it through an HTTPS tunnel such as
ngrokorcloudflared. - Set
APP_BASE_URLin.envto that public HTTPS URL. - Restart the app.
- Create an app at
https://api.slack.com/apps. - In
OAuth & Permissions:- set the redirect URL to
<APP_BASE_URL>/auth - add bot scopes
commands,chat:write, andemoji:read
- set the redirect URL to
- In
Slash Commands:- create
/stamp - set the request URL to
<APP_BASE_URL>/stamp
- create
- Copy
Client ID,Client Secret, andSigning Secretinto.env. - Visit the app root page and click
Add to Slack.
npm run start:devnpm run start:prodThe minimum required values are:
APP_BASE_URLDB_HOSTDB_PORTDB_USERDB_PASSWORDDB_NAMESLACK_CLIENT_IDSLACK_CLIENT_SECRETSLACK_SIGNING_SECRET
Optional values:
SLACK_BOT_SCOPESSLACK_STATE_SECRETTOKEN_ENCRYPTION_SECRETEMOJI_CACHE_TTL_MSAUTH_SUCCESS_REDIRECT_URL
- Install the app into your Slack workspace.
- Use the slash command followed by a single emoji name.
Example:
/stamp :thumbsup:
If the app says the workspace is not installed, open the app root page and click Add to Slack.
If you are upgrading from an older per-user token version of this app, reinstall the app in Slack once.
Workspace installations are now stored in a new slack_installations table.
Run migrations explicitly with:
npm run migration:runRevert the most recent migration with:
npm run migration:revertRun the standard checks with:
npm run lint
npm test -- --runInBand
npm run test:e2e -- --runInBand
npm run buildMIT