Search code examples
node.jsslack-apislack

How to store configuration items in a Slack App


How do you store permanent data in a Slack Application?

For example, the Opsidian slack app has a command to add your AWS keys. Where does it store those keys and how does it know to use specific keys for specific teams?

Is this on the Opsidian side? If that's the case does it just use the team.info endpoint and use that every command to match it up?

I have searched their documentation and Google with no luck.


Solution

  • A slack app usually consists of program code (e.g. PHP) and a database (e.g. MySQL) that runs on a server and interfaces with Slack through one of the APIs. All Slack team specific information is stored in a custom datadase using the unique team ID as key. The server needs to be accessible from the Internet, so that Slack can communicate with it. The server to run the program code of the app and the custom database for the app is not provided by Slack, but needs to be setup and maintained by the Slack app developer.

    Slack itself only stores the basic configuration for an app (everything you see under "Your apps", e.g. Validation token) and some basic configuration per team after installation (e.g. That an app is installed and who installed it). Any other application specific information has to be stored by the app itself in its database.

    The Slack app developer also needs to provide a custom website to allow installation of a Slack app for a team. See this answer for more info about the installation process and how to obtain a team specific access token.