Prerequisites
- A Slack app with Socket Mode enabled
- An App-Level Token with the
connections:writescope (required for Socket Mode) - Bot scopes:
chat:writeandapp_mentions:read
Setup
Create a Slack app
Go to https://api.slack.com/apps and click Create New App. Choose From scratch, give it a name, and select the workspace you want to install it in.
Enable Socket Mode and generate an App-Level Token
In your app settings, navigate to Socket Mode and toggle it on. When prompted, generate an App-Level Token. Give it any label and add the
connections:write scope. Copy the token — it starts with xapp-.Add bot scopes
Navigate to OAuth & Permissions → Scopes → Bot Token Scopes and add:
chat:write— allows the bot to post messagesapp_mentions:read— delivers events when the bot is mentioned
Install the app to your workspace
Navigate to Install App and click Install to Workspace. Authorise the requested permissions. After installation, copy the Bot User OAuth Token — it starts with
xoxb-.Edit config.toml
Open Replace both token values with your own.
~/.hiroshi/config.toml and add (or update) the [slack] section:Configuration fields
Set to
true to activate the Slack gateway. Defaults to false.Your Slack Bot User OAuth Token. Starts with
xoxb-. Used to post messages and interact with the Slack Web API.Your Slack App-Level Token. Starts with
xapp-. Required to establish the Socket Mode WebSocket connection — without it, Hiroshi cannot receive events from Slack.The Slack gateway maintains a persistent WebSocket connection for real-time event delivery with no polling delay. If the connection drops, the daemon will automatically reconnect using exponential backoff.