Meet the Salesforce SDK for building Slack apps
The acquisition of Slack, which closed in July, opens up a brand new world for Salesforce developers to build rich, conversational apps connected to their Salesforce data and metadata. But doing this is no small task. Connecting Salesforce to Slack entails standing up middleware for managing authentication, routing requests to Salesforce, building Block Kit to represent metadata, leveraging multiple frameworks, and much more, all of which require development resources. Today, in the Dreamforce developer main show, “Innovation from Anywhere with Salesforce Developers” (at 3:30pm PT), we’re proud to introduce an easier way to build Slack apps deeply integrated with Salesforce, codenamed “Foyer.”
Foyer is a collection of developer tools that empower teams to build Slack apps using the Salesforce skills they already have. It provides an SDK for crafting rich experiences extending Salesforce into Slack, and a service proxy that can handle all the plumbing — no code required! The proxy handles user mapping and routing Slack events straight to your logic, ultimately providing a single endpoint for all authorization and Slack app endpoint needs. This is a game-changer that will enable developers to create new kinds of engagement layers in Slack that harness the full power of the Salesforce Platform and their Customer 360 data.
Simplifying how Salesforce Developers build for Slack
So, while many people are familiar with Slack, Slack apps may be a newer concept. A typical Slack app allows developers to put a social, mobile, and context-aware interface right where people are already having their conversations: Slack. The app is made up of logic that is triggered by user actions, including system events (a mention, creating a channel, adding a user to a channel, etc.), as well as direct invocations via shortcuts and slash commands. A rich user experience can then be presented on various surfaces, including modals, ephemeral messages (only visible to the user), or channel messages (visible to the whole channel). It’s a whole new way to accomplish work in context of the conversation already in progress.
Deploying a Slack app generally involves setting up a middleware server (we recommend Heroku) that can accept events generated from Slack via service endpoints, invoking logic, generating UIs by producing Block Kit UI JSON, and interacting with backend systems.
Our goal with Foyer is to accelerate development and empower Salesforce developers to use the skills they already have to create Slack apps that seamlessly connect to Salesforce. Foyer supports this by providing both an SDK for UI development and a powerful service proxy that dynamically generates the endpoints needed to power your Slack app. This means that you can start to immediately think of ways to create apps that tap into Salesforce entities without worrying about the more granular details, such as setting up and hosting middleware or worrying about how UIs are created or event interactions are handled, to name a few.
For example, let’s say you have real estate management functionality in your Salesforce org and you want to build a Slack app for managing real estate support requests that interact with Salesforce data for Accounts and Contacts. Your app may have some commands in Slack that enable a member of the maintenance team to request an expert, such as an electrician, directly from the flow of a conversation regarding a customer request. But, you also want this request to be reflected on the Customer Request and related Account pages, and you want it to log the name of the customer who requested support. Creating a shortcut or slash command in Slack to facilitate this typically involves familiarity with Block Kit, Slack’s awesome UI framework, and some understanding of how to handle API requests and other interactions.
Foyer simplifies this type of experience by automatically creating modals and other UIs in Slack for you using the Salesforce metadata definitions you already have, such as your field types, validations, and much more. This means that key needs like localization, formatting, and data binding are taken care of by the SDK, resulting in rich, interactive Blocks that reflect your customizations and configurations in Salesforce. You just need to write simple view references and Foyer will turn the metadata you have into the Slack UIs that your team needs.
And with Foyer, authorization is handled for you, so you can spend more time on app logic that solves a business problem, and less time on custom code or middleware to support an OAuth flow and event routing. Now, when you build an app that features interactions or utilizes Slack events, you’ll have a single endpoint through Foyer that can consume and handle all of those events for you, simplifying and accelerating your development journey.
Leveraging Foyer to Produce Block Kit in Slack
If you can get handy with a bit of Apex, you’re going to love working with Foyer. Once you’ve created a Slack app at Slack, you can fire up your editor of choice and start building the Apex classes and Yaml views needed to support the app you have in mind. All you have to do is construct simple handlers for capturing various types of Slack integrations, such as shortcuts, actions, events, slash commands, and more. You also construct data providers to assist with data binding in the SDK, as well as those view definitions mentioned above for manifesting Salesforce metadata into different types of UIs in Slack. This means that your time is spent writing command logic and not hand-coding JSON; you’re focusing your efforts on what a cohesive experience across Slack and Salesforce should do, not on what primitives need to be orchestrated to make that magic happen.
Developers — get started soon!
We’re thrilled to provide a streamlined development experience for Salesforce developers looking to build for Slack, and we can’t wait to hear what you think. To get this party started, we’re bringing a Foyer Pilot to our ISV community in October, empowering our AppExchange builders to begin exploring new, Slack-first products and services connected to Salesforce data and logic — all delivered on the Slack App Directory. Not long after, we’ll broaden the Pilot to our developer community at large, enabling any team to quickly and securely build Slack apps that are seamless extensions of your Salesforce Customer 360. To learn more and see Foyer in action, tune into our developer main show at 3:30pm PT today on Salesforce+. We can’t wait to see what you build!
About the author
Tiaan Kruger is Director of Product Management for Foyer on the UI Platform team.