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

botkit-portal-slack

v0.1.3

Published

Add in-app customer support and ticketing to your Botkit app

Downloads

4

Readme

botkit-portal-slack

Integrate simple customer support in your Botkit Slack app

Install Package

Add this package to your project using npm:

npm install --save botkit-portal-slack

Import the adapter class into your code:

const { Portal } = require('botkit-portal-slack');

Install Portal slack app in your Slack workspace

When you install Portal into your Slack workspace, you will receive two tokens: a portal token (starts with portalt_) and a client secret (portalc_). These are required for your app to interact with the Portal service

Use Portal in your App

Configure the plugin with the URI of your app instance, and the portal token and client signing secret you'll receive when you install the Portal app.

The plugin defaults to listening for the following commands:

  • /<your_app_slash_command> [feedback | support | ...other keywords] ...any additional text : Launches our feedback modal, prepopulated with any additional text included in the command.

  • /[feedback | support | ... other keywords] ...any additional text: This requires configuring corresponding slash commands for your app at https://api.slack.com/apps/[your_app_id]/slash-commands.

  • @your_app_name [support | help | feedback| ... other keywords ] ...any additional text: This has the same functionality as slash commands. We don't (yet) support free-text @mentions - like 'hey @awesome_app, can I get some help?'.

  • Slack Actions: If you want to trigger the support dialog/modal from an IM or BlockKit action, use action_portal_launch[:type] as your action_id. If you want to be able to specify a type (e.g.: feedback v. support requsets), you can append a type to the end of your IM or Block button value.

    • You can also use this pattern for a callback_id for message actions (configure at https://api.slack.com/apps/[your_app_id]/interactive-messages) if you'd like to use them.

You can configure specific slash ('/') and at ('@') commands for your bot using the following format:

{
    listeners: {
        keywords: [list of keywords] // use this if you have common keywords you want to listen for afer all app /commands
        slash_command: [
            {
                <slash command>: [list of secondary keywords (e.g.: support, help, feedback)]
                <another command>: [] //an empty list tells portal to respond to the /command directly. This allows it to pull all text from the command as content - e.g.: /support I have a major complaint
            }
        ],
        at_mention: [list of secondary keywords], //If no secondary keywords are specified, then we respond to all @mention DMs
    }
}

One last option is to enable/disable passthrough - keeping passthrough enabled will have Portal pass all messages on to your bot once it's done, while disabling it will have Portal stop processing messages directed to Portal once they are processed. Passthrough is enabled by default, but we recommend disabling it if you have no plans to log/register/conduct additional processing.

 {
     ...
     passthrough: true,
     ...
 }

Finally, initialize the plugin and install into your app's Botkit controller: Initialize the plugin:

// or for legacy botkit apps (0.7/* and below)
let Portal = require('botkit-portal-slack')

let portal = Portal.slack({
    receiver_url: 'https://your_app_URI/', 
    portal_token: 'token_from_portal_setup', // DO NOT commit the actual token into your source code
    client_secret: 'other_token_from_portal', // DO NOT commit this token either.
    listeners: {} // see the discussion of listeners above
});

NOTE - the receiver URL should be the same base URL that you registered with Slack to receive Event API calls. Do not include /slack/receive or any other secondary routes, as Portal generates its own routes for handling cross-platform messages.

To install the plugin on bots using Botkit (v. 0.7.* and below):

controller = new Botkit.slackbot(config)

portal.init(controller)

Once registered, Botkit will automatically integrate Portal into your bot, where it will listen for support/helpdesk/feedback requests and pass support conversations back and forth between your app and your Slack workspace.

Requirements

Botkit (v 0.7.5 and below)

Node (>8.0.0)