GithubHelp home page GithubHelp logo

pebsconsulting / onboarding-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slackapi/onboarding-example

0.0 2.0 0.0 4 KB

A demonstration of how to build an onboarding app using Slack's Events API

JavaScript 100.00%

onboarding-example's Introduction

Slack Onboarding Example

This project demonstrates how to build an Onboarding App using Slack's Events API. It's meant to serve only as an example through code.

onboarding

Setup

Enable the Events

Updating the Script

The onboarding script is driven by onboarding.json. The app looks for events that match the event property in this JSON and marks it complete.

{
  "welcome": {
    "text": "Welcome to Slack! Get started by completing the steps below.",
    "attachments": [
      {
        "event": "star_added",
        "title": "Star a Message",
        "title_link": "https://get.slack.help/hc/en-us/articles/201331016-Using-stars",
        "text": "Stars are a way to mark an item in Slack as important. You can star channels or direct messages to move them to the top of your left sidebar, or star messages so you can easily come back to them later."
      },
      {
        "event": "reaction_added",
        "title": "Respond With a Reaction Emoji",
        "title_link": "https://get.slack.help/hc/en-us/articles/206870317-Emoji-reactions",
        "text": "You can quickly respond to any message on Slack with an emoji reaction. Reactions can be used for any purpose: voting, checking off to-do items, showing excitement."      
      },
      {
        "event": "pin_added",
        "title": "Pin a Message",
        "title_link": "https://get.slack.help/hc/en-us/articles/205239997-Pinning-messages-and-files",
        "text": "Important messages and files can be pinned to the details pane in any channel or direct message, including group messages, for easy reference."
      }
    ]
  }
}

Running Locally

Environment

This app requires two environment variables.

  • TOKEN - The Slack token used to post messages
  • PORT - The port to host the webserver on

WebServer

npm install
npm start

Tunneling

Using ngrok you can port a public url to your local server. After installing ngrok, you can get a url by running:

ngrok http 3000

You should get a response like this:

Tunnel Status                 online
Version                       2.1.3
Region                        United States (us)

Web Interface                 http://127.0.0.1:4040
Forwarding                    http://d8ab065c.ngrok.io -> localhost:3000
Forwarding                    https://d8ab065c.ngrok.io -> localhost:3000

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00  

Use the Forwarding url as the base url of your Request URL on Slack's Event Subscription page.

onboarding-example's People

Watchers

James Cloos avatar  avatar

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.