A simple Slack app that updates your Slack status to the game you're currently playing on Steam, the song you're listening to on Spotify, or a recent reaction you got to one of your messages on Slack.
- Create a new Firebase project
- Upgrade to Blaze plan
- Set following config variables (
firebase functions:config:set service.key="value"
):
{
"steam": {
"api_key": "xxxxxx"
},
"spotify": {
"client_secret": "xxxxxx",
"client_id": "xxxxxx",
},
"slack": {
"signing_secret": "xxxxxx",
}
}
- Create an app on Slack
- Enable
Event Subscription
- Request url:
https://<region>-<firebase-project-id>.cloudfunctions.net/events
- Subscribe to
events on behalf of a user
:reaction_added
,reaction_removed
- Add
User Token Scopes
inOAuth & Permissions
reactions:read
users.profile:read
users.profile:write
- Install App
- Set token in Firebase config:
firebase functions:config:set slack.token="xoxp-xxxxxx"
(Note: This requires that your Steam profile and game details are public. You can find these settings in your Steam profile under View Profile > Edit Profile > Privacy Settings
. Ensure that My profile: Public
and Game details: Public
are set.)
- Get a Steam API key here
- Get your numeric Steam ID:
https://<region>-<firebase-project-id>.cloudfunctions.net/steamId?username=<your Steam display name>
- Set steam id in Firebase config:
firebase functions:config:set steam.user_id="xxxxxx"
- Create a Spotify app here
- Set client id, client secret and redirect url in your Firebase config:
firebase functions:config:set spotify.client_id="xxxxxx" spotify.client_secret="xxxxxx" spotify.redirect_uri="https://<region>-<firebase-project-id>.cloudfunctions.net/spotifyOAuth"
- Get a refresh token by going through the OAUTH flow
https://<region>-<firebase-project-id>.cloudfunctions.net/spotifyConnect
- Set refresh token in Firebase config:
firebase functions:config:set spotify.refresh_token="xxxxxx"