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

@geethajyothi/atozas-pushnotification

v1.0.0

Published

Production-ready cross-platform push notification system using Socket.IO and Web Push Notifications

Readme

Atozas Push Notification System

A production-ready, cross-platform push notification system using only Socket.IO and Web Push Notifications. No Firebase, OneSignal, or third-party services required.

🎯 Features

  • Cross-Platform Support: Web (Chrome, Edge, Firefox) ↔ Android (Browser/PWA)
  • Smart Routing: Automatically uses Socket.IO for online users, Web Push for offline
  • Real-Time Delivery: Millisecond-level latency when both parties are online
  • Background Delivery: Works when tabs are closed or apps are backgrounded
  • Unified API: Single interface regardless of platform or delivery method
  • Presence Tracking: Know when users are online/offline
  • Production Ready: Built for high-traffic systems (taxi, tracking, admin alerts)

📦 Installation

npm install @geethajyothi/atozas-pushnotification

🚀 Quick Start

1. Generate VAPID Keys

npm run generate-vapid

This creates vapid-keys.json with your public and private keys.

2. Server Setup

import { PushNotificationServer } from '@geethajyothi/atozas-pushnotification';

const server = new PushNotificationServer({
  port: 3000,
  vapidPublicKey: 'your-public-key',
  vapidPrivateKey: 'your-private-key',
  vapidEmail: 'mailto:[email protected]'
});

server.start();

3. Client Setup (Web)

Option A: Standalone Example (No Build Required)

Use examples/client-example-standalone.html - it includes the client code inline and works immediately.

Option B: Compiled Client

npm run build

Then in your HTML:

<script src="https://cdn.socket.io/4.7.2/socket.io.min.js"></script>
<script type="module">
  import { PushNotificationClient } from './node_modules/@geethajyothi/atozas-pushnotification/dist/client/browser.js';

  const client = new PushNotificationClient({
    serverUrl: 'http://localhost:3000',
    userId: 'user-123',
    authToken: 'your-auth-token',
    vapidPublicKey: 'your-vapid-public-key',
    onNotification: (payload) => {
      console.log('Notification:', payload);
    }
  });

  await client.initialize();
</script>

4. Send Notification

// From server
await server.sendNotification({
  userId: 'user-123',
  title: 'New Message',
  body: 'You have a new message',
  data: { type: 'message', id: 'msg-456' }
});

📚 Documentation

🔐 Security

  • User authentication required before message delivery
  • VAPID key-based Web Push authentication
  • Socket.IO connection authentication
  • Protection against replay and duplicate notifications

🌍 Browser Support

  • Chrome/Chromium (Desktop & Android)
  • Edge (Desktop & Android)
  • Firefox (Desktop & Android)
  • Safari (limited Web Push support)

📄 License

MIT

🆘 Troubleshooting

Module Import Errors

If you see errors like "Expected a JavaScript-or-Wasm module script", you're trying to import TypeScript files directly. Use one of these solutions:

  1. Use the standalone example: examples/client-example-standalone.html
  2. Compile first: Run npm run build then import from dist/client/browser.js
  3. Use a bundler: Webpack, Vite, or similar to handle TypeScript

Service Worker Not Found

Make sure client/sw.js is copied to your public directory and accessible at /sw.js.

Push Notifications Not Working

  • Ensure HTTPS is enabled (required for Web Push, except localhost)
  • Check browser notification permissions
  • Verify VAPID keys are correct
  • Check server logs for errors

See DOCUMENTATION.md for more troubleshooting tips.