Skip to content

albarivas/ready-to-fly-sdk

Repository files navigation

Ready to Fly (Apex SDK version) [WIP]

Sample app to showcase Slack + Salesforce integrations using the Apex SDK for Slack.

Prerequisites

To be able to run this project you will need:

  • A brand new free Developer Edition org or a scratch org.
  • A Slack workspace. You can create a free workpaces following the instructions here.
  • git (download here)
  • node >= 14 (download here)
  • sfdx CLI >= sfdx-cli/7.142.0 (download here)

Setup Steps

Accept Slack terms in your org

  1. In your org, accept Slack integrations terms on setup --> Initial Slack setup

  2. In your org, accept Apex SDK terms on setup --> Build Slack Apps with Apex

Note: if you're using scratch orgs, you'll have to accept terms in your Dev Hub

Creating a Slack app at api.slack.com

  1. Open https://api.slack.com/apps/new and choose From an app manifest
  2. Select the workspace you created in the Prerequisites section
  3. Copy the contents of manifest.json into the text box that says Enter app manifest below and click Next
  4. Review the configuration and click Create
  5. Replace APP_ID on the app manifest with the Id of your app and save changes. You can copy it from the URL for the app in api.slack.com.
  6. In Basic Information scroll down to the Display Information section. Upload a picture for the app. You can use this logo
  7. In Basic Information Generate an app level token for the connections.write scope. Give it an arbitrary name.
  8. Now click Install App. Then click the Install to Workspace button and then click on Allow

Prepare the Slack app metadata and deploy

  1. Clone the ready-to-fly-sdk repository
git clone https://github.com/albarivas/ready-to-fly-sdk
  1. Open ReadyToFlyPlaceHolder.slackapp-meta.xml and modify the secrets that you can copy from the Basic Information tab of your app at api.slack.com:
  • appKey: App ID
  • appToken: the value of the app-level token you've created
  • clientKey: Client ID
  • clientSecret: Client Secret
  • signingSecret: Signing Secret

Rename the file to be called ReadyToFly.slackapp-meta.xml. This file is ignored and won't be commited to the repo.

  1. Replace your team Id into Slack_Workspace_ConfigurationPlaceHolder.Apex_SDK_Starter_Kit.md-meta.xml. You can get it from the URL when you navigate to https://your_workspace.slack.com/. Rename the file to be called Slack_Workspace_Configuration.Apex_SDK_Starter_Kit.md-meta.xml. This file is ignored and won't be commited to the repo.

  2. Deploy the code

sfdx force:source:deploy -p force-app/main/default

or, if using a scratch org:

sfdx force:source:push
  1. Assign permission set
sfdx force:user:permset:assign --permsetname Ready_to_Fly
  1. Load sample data
sfdx force:apex:execute --apexcodefile data/setup.apex

Note: the test data creation class assumes there is a "Standard Platform User" profile in your org. Change it accordingly if that's not your case.

  1. Go to your Slack workspace and click on "Add Apps". Select "Ready to Fly (SDK)".

Make sure to execute the /view-travel-request-status slash command or the "Create Travel Request" global shortcut to connect to the org for the first time. Your app home won't work until you execute this step.

Once done that, go to the app home tab --> you should see a couple of travevl requests to review!

Resources

  1. Apex SDK Documentation

  2. Ready to Fly (Bolt.js)

  3. Slack Next Generation Platform

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages