I'm using Slack Bolt JS api. Can successfully install apps into slack workspaces following the http://example.com/slack/install URL. I'm trying to integrate this into a SaaS. The question is how to distinguish Slack app installations and how to determine which Slack app installation belongs to which of the SaaS user? My guess is that some information should be injected during the OAuth flow, but now sure how to do that using Slack Bolt SDK.
const app = new App({
installerOptions: {
installPath: '/slack/install',
redirectUriPath: '/slack/oauth_redirect'
},
// token, etc
});
seems like you need to implement authentication with OAuth and your own installationStorage
. Take a look this doc
The basic steps that you need to cover are:
SLACK_CLIENT_ID
, SLACK_SECRET_ID
and SLACK_SIGNING_SECRET
installationStore
option).database.set
and database.get
by your own database query, server API or something else. Here you can see a full example.After this setup, slack will call your app from many different workspace and the correct token will be recovered thowth installationStore.fetchInstallation
. This will happen before call the event or message handler.
PS: You should not include token in the initialization of the app. It will be set later.