npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

slack-devkit

v1.2.3

Published

A Slack developer kit to make building distributed Slack apps easy.

Downloads

20

Readme

Slack DevKit

Slack DevKit is a light-weight developer kit to build Slack Apps in node.js super fast. No previous knowledge about building Slack Apps or Bots needed! Plus, automatic support for verifying requests from Slack and responding to validations.

This was made to build Slack Apps on Glitch even faster, but it works everywhere!

Learn more on SlackDevKit.com

Overview

Features

  • OAuth support without 3rd-party database
  • Supports Single Channel Installations
  • Verifies request signatures and/or verification tokens
  • Support for short-lived tokens with automatic refresh
  • Automatic retrieval of workspace's authentication info
  • Auto-parsing of string-encoded JSON payloads
  • Authenticated HTTP client for Slack's API
  • Writeable datastore associated to the workspace

What's Included

Examples

| File | Description | | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | features.js | Examples of some common Slack App features | | internal-integration.js | Example configuration of an internal integrations | | storing-data.js | Example of storing and retrieving data from the datastore | | express.js | Example of adding Slack DevKit to an exiting Express.js server | | lambda.js | Using Slack DevKit with AWS Lambda and DynamoDB |

Getting Started

Install

npm i slack-devkit

Usage

const Slack = require('slack-devkit');

// Configure express with the Slack App settings
const { server } = new Slack({
  scope: 'chat:write,bot',
  client_id: '1212313.1231231231231',
  client_secret: '12312312323123123',
  signing_secret: 'sdfsadfsadfasdfas',
  redirect_uri: 'https://myserver.com', // optional
  datastore: '.data/workspaces' // optional
});

// All GET routes redirect to the “Add to Slack” OAuth flow
server.get('/', (req, res) => {
  req.slack.data; // the authenticated workspace info
  res.send();
});

// All POST routes expect Slack callback events
// and verify against the verification token
server.post('/', (req, res) => {
  const user = req.slack.user_id;
  req.slack.api('users.info', { user }).then(r => {
    r.data; // the results of 'users.info' API request
  });
  res.send();
});

// Start the webserver on port 3000
server.start(3000);

Configuration

The configuration options used for the constructor

| Name | Type | Description | | -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | scope | Required | Slack OAuth scopes | | client_id | Required | Slack OAuth client id | | client_secret | Required | Slack OAuth client secret | | redirect_uri | Optional | Slack OAuth redirect uri | | signing_secret | Optional | Slack signing secret | | verification_token | Optional | Slack verification token | | access_token | Optional | Access token for internal integrations | | slack_root | Optional | Root domain to use for Slack requests | | datastore | Optional | File path to write to or a DataStore object |