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

pingboxjs

v1.0.3

Published

Native push notifications for websites without native apps

Readme

pingboxjs

pingboxjs is a JavaScript SDK that lets websites send real native mobile push notifications without building a native mobile app.

Instead of browser notifications, users install a single companion Android app once. After a one time device binding, any website using pingboxjs can send true native notifications that work even when the browser is closed.

The purpose of pingboxjs is simple. Enable native mobile notifications using only JavaScript.

How it works

  1. The user installs the pingbox companion Android app
  2. The user visits your website
  3. Your website generates a binding code
  4. The user enters the code inside the mobile app
  5. The device is linked to your website
  6. Your website can now send native push notifications

Requirements

  1. A running pingbox backend server
  2. A Firebase project with Firebase Cloud Messaging enabled
  3. The pingbox Android mobile app installed on the user device

Getting an API key

To use pingboxjs you need an API key generated from the developer dashboard.

Run the dashboard locally or deploy it:

cd pingbox-dashboard
npm install
npm run dev

Open http://localhost:3000 in your browser and register your website to generate an API key.

Backend setup

The backend handles device binding and notification delivery and requires Firebase.

cd pingbox-backend
npm install
# place your firebase service account file in this folder
node server.js

By default the backend runs on http://localhost:3001.

Important. When testing on a real Android device, replace localhost with your computer local IP address.

Mobile app

The pingbox Android app must be built and installed manually.

cd pingboxapp
npm install
cd android && ./gradlew assembleRelease

The generated APK can be found at:

android/app/build/outputs/apk/release/app-release.apk

Install this APK on the Android device.

Installing the SDK

For local development, include the built SDK file:

<script src="/path/to/pingbox.min.js"></script>

When published to npm:

npm install pingboxjs

The SDK is used through the global pingbox object.

Initializing pingboxjs

pingboxjs uses an init based API and does not use a constructor.

const pingbox = pingbox.init("YOUR_API_KEY", {
  baseUrl: "http://YOUR_LOCAL_IP:3001",
  logLevel: "debug"
});

baseUrl must point to your running backend server.

Binding a device

Generate a binding code and display it to the user.

const { bindingCode, expiresIn } = await pingbox.lockin();

console.log("Enter this code in the pingbox app:", bindingCode);
console.log("Expires in", expiresIn, "seconds");

The user enters this code inside the mobile app to complete the binding.

Sending a notification

Once a device is bound, you can send notifications at any time.

await pingbox.shoot(
  "Welcome",
  "Thanks for joining our platform",
  {
    url: "https://yourwebsite.com",
    queueIfOffline: true
  }
);

Notifications are delivered as real native mobile notifications.

If the backend is temporarily unreachable, notifications are automatically queued and retried.

Minimal example

<!DOCTYPE html>
<html>
<body>
  <button onclick="connect()">Bind Device</button>
  <button onclick="notify()">Send Notification</button>

  <script src="/path/to/pingbox.min.js"></script>
  <script>
    const pingbox = pingbox.init("YOUR_API_KEY", {
      baseUrl: "http://YOUR_LOCAL_IP:3001"
    });

    async function connect() {
      await pingbox.lockin();
      alert("Enter the displayed code in the pingbox app");
    }

    async function notify() {
      await pingbox.shoot("Hello", "Notification from the web");
    }
  </script>
</body>
</html>