Skip to main content

Slack Setup

People Portal creates channels, invites and removes members, and looks people up by email. All of that runs through one bot token, which comes from installing a Slack app into a workspace. You must be a workspace admin, or have one approve the install.

Slack cannot be self-hosted, so there is nothing to script here and no local equivalent. Staging and production each need their own workspace.

Creating the app​

  1. Go to api.slack.com/apps → Create New App → From scratch. Name it and pick the workspace.
  2. OAuth & Permissions → Scopes → Bot Token Scopes. Add the scopes below.
  3. Install to Workspace at the top of that page, and approve the consent screen.
  4. Copy the Bot User OAuth Token, starting xoxb-, into PEOPLEPORTAL_SLACK_BOT_TOKEN.
  5. Set PEOPLEPORTAL_SLACK_INVITE_URL to the workspace's invite link.

Scopes​

Derived from the nine Web API methods in clients/SlackClient/index.ts:

MethodScope
auth.testnone
chat.postMessagechat:write
conversations.create, .archive, .invite, .kickchannels:manage, plus groups:write for private channels
conversations.list, .memberschannels:read, plus groups:read for private channels
users.lookupByEmailusers:read, users:read.email

Token handling​

Unlike an AWS secret key, a bot token stays visible on the OAuth page, so you can return for it rather than rotating when you lose it.

Adding a scope after installing requires reinstalling the app, which issues a new token. Paste it in again wherever the old one lives.

To rotate deliberately: OAuth & Permissions → Reinstall to Workspace for a fresh token, or Settings → Install App → Revoke first if you need the old one dead immediately.

Variables​

VariableNotes
PEOPLEPORTAL_SLACK_BOT_TOKENThe xoxb- token. SlackClient throws at construction if unset
PEOPLEPORTAL_SLACK_INVITE_URLWorkspace invite link surfaced to new members

SLACK_ACCESSTOKEN appears in some deployment environments but is read nowhere in the server source. Only PEOPLEPORTAL_SLACK_BOT_TOKEN matters.

Verifying​

SlackClient validates lazily: it constructs successfully against any non-empty string, so startup logging Initializing Shared Resource Client: slackClient proves only that the variable is set. A placeholder token fails at the first real API call, surfacing as invalid_auth in the container logs rather than at boot.

Copyright © 2026 Atheesh Thirumalairajan