Multi-user app that updates each connected user's Slack status with their currently playing Spotify track.
- Copy
.env.exampleto.env. - Create a Slack app and set the redirect URL to
http://localhost:3000/auth/slack/callback. - Add Slack user scopes:
users.profile:writeandusers.profile:read. - Create a Spotify app and set the redirect URI to
http://localhost:3000/auth/spotify/callback. - Fill in
SLACK_CLIENT_ID,SLACK_CLIENT_SECRET,SPOTIFY_CLIENT_ID, andSPOTIFY_CLIENT_SECRET. - Run
npm start. - Open
http://localhost:3000and connect Slack, then Spotify.
Use npm run local for the old single-user local watcher.
The hosted app can read Spotify through the Spotify API, but Steam and desktop apps must be detected on the user's own computer.
Run the local agent on the user's computer:
$env:SERVER_URL="https://your-app-name.herokuapp.com"; npm run local-agentThe agent opens the hosted app in the browser. After the user authorizes Slack and Spotify, the agent saves its local token in ~/.slack-activity/agent.json and starts reporting Steam games and supported desktop apps. Fresh local activity takes priority over Spotify.
Attach Heroku Postgres before connecting users:
heroku addons:create heroku-postgresql:essential-0 -a your-app-nameHeroku will set DATABASE_URL automatically. Without Postgres, connected users are stored in SQLite and will disappear after redeploys or dyno restarts.
Set these config vars to your Heroku app URL:
BASE_URL=https://your-app-name.herokuapp.com
SLACK_REDIRECT_URI=https://your-app-name.herokuapp.com/auth/slack/callback
SPOTIFY_REDIRECT_URI=https://your-app-name.herokuapp.com/auth/spotify/callbackAdd the same callback URLs in the Slack and Spotify app dashboards.