Search code examples
slackslack-api

Programmatically Get App-Level Token for Slack App with Socketmode Enabled


I created a Slack App with Socketmode enabled. I am trying to distribute this app and I need to generate App-Level token after application is installed to workspace. Currently, I am able to use Slack Oauth flow to get bot access token, but I couldn't find how to get app-level token for each installation. App-level token is a must have parameter for socketmode. Do you know,

  • If I can get it from Oauth response?
  • I can generate app level token programmatically?

Solution

  • The app-level token in Slack platform represents your app and your app alone. It isn't attached to a specific workspace installation.

    When you connect to socket mode using an app-level token, the perspective on the stream is that of all possible workspaces your app is installed in.

    You'll still need workspace-level tokens to use the Web API on behalf of your app-workspace or app-workspace-user relationship, often in response to events you receive.

    But the app token is really an that lives outside of OAuth and workspaces.