Slack has traditionally been associated more with non-Salesforce backends such as AWS. Now that Slack is a Salesforce product, Salesforce developers are probably curious about what is like to develop Slack apps. Good news! Salesforce is a wonderful backend for building Slack Apps! This post will show you how you can use your existing, Slack Apps with Apex on Salesforce.
Salesforce is a good platform for building many Slack apps on. We will talk about include concepts such as security, surfaces, interactions, and an overview of the various Slack APIs.
Transferable skills
Salesforce has a database and Apex, as well as APIs but Slack just has APIs.
Similarities between Apex and Slack
- Slack Web API / Salesforce REST API
- Slack bots / Service Account in Salesforce (integration user)
- Slack Events API / Salesforce Platform events
- Workspace / Dev org
- Global, message shortcuts / Global quick actions, object quick actions
- Block Kit / Lightning Base Components
Slack APIs for Salesforce
- 🛑 RTM API (WebSocket, older, doesn’t support some of the new rich features)
- 🛑 Socket Mode (WebSocket for Web API / Interactivity)
- 🟡 Slack Incoming Webhooks (old school, simple)
- ✅ Events API over HTTP (Slack calls your endpoint)
- ✅ Slack Web API
Surfaces (ways your app can present to the user)
- App Home Tab
- Modals (Block Kit)
- Messages (text or Block Kit)
Slack Events
- Passive way to do things similar to Interactivity.
- New user joins a channel
- User deletes a message
- User adds emoji reaction
- User sends a message
Security
Think of endpoint URLs like password. Long and strong. We get 2 or 3 chances with a URL! Token verification or signature verification. Grant proper guest access to platform events and Apex Classes.
Slack Apps with Apex on Salesforce Video
Summary
Now we understand how to build Slack Apps with Apex on Salesforce. Check this repo for complete code used in demo.