How to Handle OAuth for a Custom Slack Integration on Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, I am a new user and writing a custom slack integration. It can handle the slash command and respond on my workspace. Then I would like to distribute it to another workspace. I think I need to handle OAuth when registered on a workspace. How can I do that on pipedream? It would be helpful if there is a sample code.

Good question, for this kind of flexibility I suggest building a Slack Bot instead of using the native Pipedream Slack app.

Then you can use the Install to workspace in the Slack Bot’s dashboard in the Slack API and install it to multiple workspaces if you have permissions to install bots on the workspaces you’re a member of.

All you’ll need to do is leverage the Slack Bot token to make authenticated requests from Pipedream workflows.

thanks! What if you are going to distribute it publicly on slack app store? Do you need to write some web app and pass tokens to pipedream?

I don’t believe you’ll need to, just because the Slack Bot token is the same across many workspaces. The bot is only registered once.

However if you use the native Pipedream Slack integration, that is using the Pipedream’s Slack bot, so therefore Pipedream’s Slack app would need to be installed on every workspace that uses that integration.

That’s why I recommend using the Slack Bot actions instead, you can use your own Bot & credentials instead of the official Pipedream Slack bot.