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

simple-screenshot-feedback

v1.0.9

Published

Plug and play screenshot feedback tool that sends to Slack.

Downloads

56

Readme

simple-screenshot-feedback

Full demo

A simple plug and play feedback component for your website. Enable users to take screenshots of specific parts of your application and send feedback to a slack channel.

Documentation

Installation

yarn install simple-screenshot-feedback

or

npm install --save simple-screenshot-feedback

Usage

import Feedback from "simple-screenshot-feedback"

export default function SomePage() {
  return (
    <>
      ...
      <Feedback slackToken={...} slackChannel={...} handleSubmitError={...} />
    </>
  )
}

Getting your Slack token

  1. Log in to your Slack workspace at api.slack.com/apps
  2. Click Create New App
  3. Navigate to the OAuth & Permissions page by clicking on the left menu
  4. Scroll down to Bot Token Scopes and add at minimum:
    • chat:write - allows the bot to write in private channels it is added to
    • chat:write.public - allows the bot to write in public channels
  5. Go back to the top of the page and click Install App to Workplace, click Allow
  6. You'll then be returned to the OAuth & Permissions page where you'll now see a Bot User OAuth Access Token

This is the token that you need to pass in to this component (slackToken) to start sending feedback to Slack.

Choosing a Slack channel

With the permissions you gave your new Slack app in Getting your Slack token you can now send feedback to any public channel by passing the channel name (e.g. #feedback) into the component (slackChannel).

If you want to post to a private channel you first need to invite the new Slack app to it by typing /invite @[APP NAME].

Options

| Prop | optional | default | type | |:--------|:-------:|:-------:|--------:| | slackToken | false | | string | | slackChannel | false | | string | | handleSubmitError | false | | (err: Error) => void | | location | true | "bottom-right" | "top-left" | "top-middle" | "top-right" | "bottom-left" | "bottom-middle" | "bottom-right"

SSR

This component uses the html2canvas library which depends on the window object being available. If you're using server-side rendering you'll want to make sure this component is only imported on client render using dynamic imports.

Here's an example with next/dynamic:

import dynamic from "next/dynamic";
import React from "react";

const FeedbackImport = dynamic(() => import("simple-screenshot-feedback"), { ssr: false });

export default function Feedback({ slackToken, slackChannel, handleSubmitError }) {
  return (
    <FeedbackImport
      slackToken={slackToken}
      slackChannel={slackChannel}
      handleSubmitError={handleSubmitError}
    />
  );
}