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 🙏

© 2026 – Pkg Stats / Ryan Hefner

shake-report-web-sdk

v1.0.1

Published

A React web SDK for shake-to-report and button-triggered bug reporting.

Readme

shake-report-web-sdk

A clean, lightweight, and reliable React JS web SDK that adds bug reporting features (Shake to Report for PWAs and a floating widget for desktop) to your web applications. It handles device motion detection, captures client-side screenshots via html2canvas, gathers system metadata, and displays an elegant modal to submit reports directly to your server.


Features

  • PWA Shake Detection: Triggers bug reporting automatically via a physical device shake gesture on mobile web browsers using DeviceMotionEvent.
  • Desktop Widget: Displays a sleek, customizable floating button with a bug icon in the bottom-right corner for non-touch devices.
  • Client-Side Screenshots: Automatically grabs a visual snapshot of the page using html2canvas, letting users preview and toggling it inside the feedback form.
  • Zero-Config Styles: Dynamically injects style sheets so you don't have to configure special webpack/CSS loaders.
  • Metadata Harvesting: Extracts details about the browser version, operating system, current URL, viewport size, and network language.

Installation

Install the package via npm or yarn:

npm install shake-report-web-sdk
# or
yarn add shake-report-web-sdk

Usage

1. Basic Integration

Wrap your React root component inside ShakeReportProvider.

import React from 'react';
import { ShakeReportProvider } from 'shake-report-web-sdk';
import MainApp from './MainApp';

export default function App() {
  return (
    <ShakeReportProvider
      apiUrl="https://api.yourdomain.com"
      apiKey="YOUR_CLIENT_SDK_KEY"
      user={{
        id: 'web_user_9921',
        name: 'Jane Doe',
        email: '[email protected]',
      }}
      enableShake={true}
      showFloatingButton="desktop-only"
    >
      <MainApp />
    </ShakeReportProvider>
  );
}

2. Custom Themes

Customize colors of the floating button and the bug report form by passing a theme prop:

<ShakeReportProvider
  apiUrl="https://api.yourdomain.com"
  apiKey="YOUR_CLIENT_SDK_KEY"
  theme={{
    primaryColor: '#8B5CF6',         // Violet accent
    textColor: '#111827',            // Light mode custom text
    backgroundColor: '#FFFFFF',      // Light mode background
    inputBackgroundColor: '#F3F4F6',
    borderColor: '#E5E7EB',
  }}
>
  <MainApp />
</ShakeReportProvider>

3. Programmatic Trigger

Trigger the bug reporter manually (e.g. from a help desk button) using the useShakeReport hook:

import React from 'react';
import { useShakeReport } from 'shake-report-web-sdk';

export default function HelpButton() {
  const { openReporter } = useShakeReport();

  return (
    <button onClick={openReporter} className="help-btn">
      Report a Bug
    </button>
  );
}

Configuration Props

ShakeReportProviderProps

| Prop Name | Type | Required | Description | | :--- | :--- | :--- | :--- | | apiUrl | string | Yes | Server base URL (e.g., https://api.domain.com). | | apiKey | string | Yes | Client API key appended to headers as x-sdk-api-key. | | user | ShakeReportUser | No | Logged-in user information (id, name, email). | | enableShake | boolean | No | Toggle shake detection listener on mobile web/PWA. Default is true. | | showFloatingButton | 'always' \| 'desktop-only' \| 'never' | No | Floating bug icon trigger. Default is 'desktop-only'. | | theme | ShakeReportTheme | No | Override colors (primary, background, success, etc.). | | appVersion | string | No | Version metadata of the host application (default is '1.0.0-web'). | | onReportSubmitted | (response: any) => void | No | Callback invoked on successful report submission. | | onReportFailed | (error: unknown) => void | No | Callback invoked when API request fails. |