Setting Up Serverless Reactor

For Video Tutorial: 👉 Every Step to Set Up Serverless Reactor

1. Create a new app on Slack

Go to Application section of Slack API. Click Create An App.

1

Select From Scratch.

2

Enter the name for the app and pick a workspace for your app. Then click Create App.

3

2. Set up OAuth

Go to Features > OAuth & Permissions on the sidebar.

4

Scroll down to Scopes. Set up Bot Token Scopes and User Token Scopes as follows:

Bot Token Scopes:
- chat:write
- files:read
- im:history
- im:read

User Token Scopes:
- users:read
- files:write

5

Go back to the top. Click Install to Workspace under OAuth Tokens for Your Workspace.

6

Click Allow to grant permissions.

7

Now you have User OAuth Token and Bot User OAuth Token. These tokens will be used later when setting up parameters on Serverless Reactor console.

8

3. Set up parameters on Serverless Reactor console

Log in to Serverless Reactor console. Go to Apps on the top bar. Click New App.

9

Fill in the name and description of your app under Name and Desc.

10

Fill in App ID and Verification Token. They can be found in Settings > Basic Information > App Credentials of your Slack app.

Fill in App Secret with Client Secret.

11

Fill in Slack User OAuth Token and Slack Bot User OAuth Token with the tokens we created in Step 2.

13

Click Save after setting up all the parameters.

Unfortunately, Welcome Message is currently not supported for Slack.

4. Code with RUST and compile into Wasm

Now you can write your RUST code and compile it into a Wasm file.

We have provided you with a coding template for this step. Simply fork this repo on GitHub and edit the RUST file in src/lib.rs. Then use rustwasmc build to compile your code into a Wasm file. The coding template implements a simple calculator.

Please refer to the repo's README.md for a detailed walk-through.

5. Upload Wasm to Serverless Reactor console

Go to Apps on Serverless Reactor console . Find your app and click Upload Wasm File.

14

Choose your local Wasm file to upload. Then, click Save.

15

6. Subscribe for events

Copy the service URL for Slack of your app from Serverless Reactor console. (Click For Slack on the Service URL column.)

16

Go to Features > Event Subscription on the sidebar. Turn on Enable Events.

17

Fill in Request URL. Request URL is the service URL you have copied appending /event to the end.

Example:
Service URL copied: 		https://slack.reactor.secondstate.info/60c774c6a15a7bc1e0b9a65d
Request URL to fill in: https://slack.reactor.secondstate.info/60c774c6a15a7bc1e0b9a65d/event

Expand Subscribe to bot events. Click Add Bot User Event and add message.im.

Click Save Changes.

18

7. Install app on Slack

Go to Features > App Home on the sidebar.

Turn on Always Show My Bot as Online.

19

Under Show Tabs > Message Tab, check Allow users to send Slash commands and messages from the messages tab.

20

Now your Slack app is ready to go!

8. Testing and updating your Slack app

You can test your app by sending messages and Slash commands to your app.

In the example below, our app is a calculator:

21

If you want to update your app, you can simply upload a new Wasm file to your app on Serverless Reactor console.