Giter VIP home page Giter VIP logo

slack-rtm-min's Introduction

Slack Minimal RTM client

A bare bones program to connect to Slack's RTM API. The purpose of this program is to inspect messages on an RTM connection when debugging. Since it has practically no dependencies, issues are isolated from any framework or tools a developer might use to build a client.

While its not designed to be a library, or a package for you to import, it can be useful as a starting point if you want the absolute minimum for your application.

Usage

Before you get started, you need a token to connect to the Slack API. Slack has many ways to get a token including Bot User tokens (xoxb) and OAuth Access tokens (xoxp). Any of these will do.

Also note that this program is built for node v6 or greater (see .nvmrc).

Clone the repository:

git clone https://github.com/aoberoi/slack-rtm-min.git

Install the dependencies:

npm install

Now you're ready to run the program, but you have a few options in the form of environment variables.

Environment Variable Required Type Default Description
SLACK_TOKEN โœ… string none the token used to authorize the connection
SLACK_RTM_METHOD 'rtm.connect' or 'rtm.start' 'rtm.connect' the Web API method used to retrieve the WebSocket URL
SLACK_RTM_PARAMS JSON string '{}' additional parameters to send with the web api method chosen in SLACK_RTM_METHOD
SLACK_ENV string production (https://slack.com/api/) (internal use)

Run the program with environment variables set:

SLACK_TOKEN=xoxb-000000000000-aaaaaaaaaaaaaaaaaaaaaaaa node index.js

Note: you may set the environment variables in any way you choose, doing so on the command line is just one option.

slack-rtm-min's People

Contributors

aoberoi avatar

Stargazers

Vladyslav Hrytsenko avatar  avatar Bertrand Fan avatar

Watchers

 avatar James Cloos 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.