Coder Social home page Coder Social logo

bolt-js-webinar-jan-2021's Introduction

Jan 2021 Webinar Bolt-js Demo App

This is a quick example app showing off some of the functionality available in bolt-js.

Local development requires a public URL where Slack can send requests. In this guide, we'll be using ngrok. Checkout this guide for setting it up.

Before we get started, make sure you have an Enterprise Grid sandbox to deploy and test your application. You can submit the sandbox request form to be provisioned two sandboxes. You also need to create a new app if you haven’t already in one of the sandbox workspaces.

Install Dependencies

npm install

Install app to workspace

In your App Configuration, go to OAuth & Permissions and add the channels:history, app_mentions:read, commands and chat:write permissions. Click install App to install the app to your workspace and generate a bot token.

Setup Environment Variables

This app requires you setup a few environment variables. You can get these values by navigating to your App Config Page.

export SLACK_BOT_TOKEN=YOUR_SLACK_CLIENT_SECRET
export SLACK_SIGNING_SECRET=YOUR_SLACK_SIGNING_SECRET

Run the App

Start the app with the following command:

npm start

This will start the app on port 3000.

Now lets start ngrok so we can access the app on an external network and create a redirect url for OAuth and request url for Events and Interactivity.

ngrok http 3000

This should output a forwarding address for http and https. Take note of the https one. It should look something like the following:

Forwarding   https://3cb89939.ngrok.io -> http://localhost:3000

Navigate to the App Home page in your App Configuration and enable it. Then navigate to Event Subscriptions to enable it. The request URL should be set to your ngrok forwarding address with the slack/events path appended. Use the same url to enable Interactivity and Shortcuts. example url:

https://3cb89939.ngrok.io/slack/events

In the Events Subscription page, click Subscribe to bot events and add app_home_opened, app_mentioned, and message.channels.

Lastly, navigate to OAuth & Permissions in your App Config and add a redirect url. The redirect url should be set to your ngrok forwarding address with the slack/oauth_redirect path appended. ex:

https://3cb89939.ngrok.io/slack/oauth_redirect

bolt-js-webinar-jan-2021's People

Contributors

stevengill avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

digas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.