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

@razor_rsd/ytnotify

v1.0.13

Published

A lightweight Node.js package for receiving real-time YouTube video upload notifications using PubSubHubbub/WebSub protocol. Features TypeScript support, Express middleware integration, secure webhooks, and easy-to-use event-based notifications. Perfect f

Downloads

9

Readme

YT Notify

A lightweight Node.js package for receiving real-time YouTube video upload notifications using PubSubHubbub/WebSub protocol.

npm version License: MIT

Features

  • Real-time notifications for new YouTube video uploads
  • Support for multiple channel subscriptions
  • Event-based notification system
  • Express middleware support
  • TypeScript support
  • Secure webhooks with secret validation

Installation

npm install @razor_rsd/ytnotify

Usage

import express from 'express';
import { YTNotify } from '@razor_rsd/ytnotify';

const app = express();

const ytNotify = new YTNotify({
  hubCallback: 'https://your-domain.com/youtube-webhook',
  secret: 'your-secret-key',
  path: '/youtube-webhook'
});

// Subscribe to a channel
ytNotify.subscribe('CHANNEL_ID');

// Subscribe to multiple channels
ytNotify.subscribe(['CHANNEL_ID_1', 'CHANNEL_ID_2']);

// Listen for new video notifications
ytNotify.on('notify', (data) => {
  console.log('New video uploaded:', data);
  // data includes: id, channelId, title, link, author, published, updated
});

// Listen for subscription updates
ytNotify.on('subscribe', (data) => {
  console.log('Subscription updated:', data);
});

// Use as middleware
app.use('/youtube-webhook', ytNotify.listener());

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Configuration Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | hubCallback | string | Yes | - | Your webhook URL where notifications will be received | | secret | string | Yes | - | Secret key for webhook validation | | middleware | boolean | No | false | Enable Express middleware mode | | path | string | No | "/" | Webhook path for the middleware | | hubUrl | string | No | "https://pubsubhubbub.appspot.com" | PubSubHubbub hub URL |

API Reference

Methods

subscribe(channel: string | string[])

Subscribe to receive notifications from one or multiple YouTube channels.

unsubscribe(channel: string | string[])

Unsubscribe from one or multiple YouTube channels.

isSubscribed(channelId: string): Promise<IIsSubscribed>

Check the subscription status of a channel.

listener()

Returns an Express middleware function for handling webhook requests.

Events

notify

Emitted when a new video is uploaded. Provides video details including:

  • id: Video ID
  • channelId: Channel ID
  • title: Video title
  • link: Video URL
  • author: Channel name
  • published: Publication date
  • updated: Last update date

subscribe

Emitted when a subscription is confirmed.

unsubscribe

Emitted when an unsubscription is confirmed.

TypeScript Support

The package includes TypeScript definitions and supports the following interfaces:

interface INotifyData {
  id: string;
  channelId: string;
  title: string;
  link: string;
  author: string;
  published: string;
  updated: string;
}

interface IUpdateSubscription {
  type: "subscribe" | "unsubscribe";
  channel: string | string[];
  expirationTime?: string;
}

License

MIT

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.