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

@momen124/ai-monitor-notifiers

v1.0.0

Published

Notification providers for AI Monitor - Telegram, Slack, Email

Readme

@momen124/ai-monitor-notifiers

Notification providers for AI Monitor
Telegram, Slack, Email, and Multi-channel support

License: MIT TypeScript

✨ Features

  • 📱 Telegram - Send alerts via Telegram bot
  • 💬 Slack - Beautiful formatted messages via webhook
  • 📧 Email - HTML and text emails via SMTP
  • 🔀 Multi-Channel - Send to multiple channels simultaneously
  • 🔌 Plug-and-Play - Works seamlessly with @momen124/ai-monitor-core
  • 🌳 Tree-Shakeable - Only bundle what you use

📦 Installation

# Install core package
npm install @momen124/ai-monitor-core

# Install notifiers package
npm install @momen124/ai-monitor-notifiers

# Install peer dependencies for the notifiers you want to use
npm install telegram     # For Telegram
npm install axios        # For Slack
npm install nodemailer   # For Email

🚀 Quick Start

Telegram Notifier

import { AIMonitor } from "@momen124/ai-monitor-core";
import { TelegramNotifier } from "@momen124/ai-monitor-notifiers";

const monitor = new AIMonitor({
  notifiers: [
    new TelegramNotifier({
      token: "YOUR_BOT_TOKEN",
      chatId: "YOUR_CHAT_ID",
    }),
  ],
});

await monitor.start();

Slack Notifier

import { SlackNotifier } from "@momen124/ai-monitor-notifiers";

const monitor = new AIMonitor({
  notifiers: [
    new SlackNotifier({
      webhookUrl: "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
    }),
  ],
});

Email Notifier

import { EmailNotifier } from "@momen124/ai-monitor-notifiers";

const monitor = new AIMonitor({
  notifiers: [
    new EmailNotifier({
      host: "smtp.gmail.com",
      port: 587,
      secure: false,
      auth: {
        user: "[email protected]",
        pass: "your-app-password",
      },
      from: "AI Monitor <[email protected]>",
      to: ["[email protected]", "[email protected]"],
    }),
  ],
});

Multi-Channel Notifier

Send to all channels at once:

import {
  MultiNotifier,
  TelegramNotifier,
  SlackNotifier,
} from "@momen124/ai-monitor-notifiers";

const monitor = new AIMonitor({
  notifiers: [
    new MultiNotifier({
      notifiers: [
        new TelegramNotifier({
          /* ... */
        }),
        new SlackNotifier({
          /* ... */
        }),
        new EmailNotifier({
          /* ... */
        }),
      ],
    }),
  ],
});

// Alert will be sent to all three channels
await monitor.alert({
  severity: "CRITICAL",
  title: "System Down",
  message: "Production server is not responding",
});

📚 API Reference

TelegramNotifier

new TelegramNotifier(config: ITelegramConfig)

interface ITelegramConfig {
  token: string;                        // Bot token from @BotFather
  chatId: string;                       // Chat ID to send messages to
  parseMode?: 'Markdown' | 'HTML';     // Message format (default: 'Markdown')
  disableWebPagePreview?: boolean;     // Disable link previews (default: true)
}

Getting Telegram credentials:

  1. Create bot via @BotFather
  2. Get chat ID by messaging @userinfobot

SlackNotifier

new SlackNotifier(config: ISlackConfig)

interface ISlackConfig {
  webhookUrl: string;  // Slack webhook URL
}

Getting Slack webhook:

  1. Go to https://api.slack.com/apps
  2. Create an app → Incoming Webhooks → Add to Workspace
  3. Copy webhook URL

EmailNotifier

new EmailNotifier(config: IEmailConfig)

interface IEmailConfig {
  host: string;           // SMTP server host
  port: number;           // SMTP server port
  secure?: boolean;       // Use TLS (default: false)
  auth: {
    user: string;         // SMTP username
    pass: string;         // SMTP password
  };
  from: string;           // From address
  to: string | string[];  // Recipient(s)
}

MultiNotifier

new MultiNotifier(config: IMultiNotifierConfig)

interface IMultiNotifierConfig {
  notifiers: INotifier[];       // Array of notifiers
  stopOnFirstError?: boolean;   // Stop on first failure (default: false)
}

🎨 Message Formatting

Alert Messages

All notifiers format alerts with:

  • Severity emoji (🚨 Critical, ⚠️ Warning, ℹ️ Info)
  • Title and message
  • Timestamp
  • Optional metrics

Pipeline Status

  • Status emoji (✅ Success, ❌ Failure, ⚠️ Unstable, ⏹️ Aborted)
  • Job name and build number
  • Duration
  • Changes list (if provided)
  • Build URL (if provided)

Deployment Notifications

  • Environment and version
  • Status
  • Duration
  • Changes
  • Environment URL

Daily Reports

  • Overall health status
  • Summary metrics (alerts, auto-fixes, uptime)
  • Top issues list

🎯 Examples

Conditional Notifiers

const notifiers = [];

// Always use Telegram
notifiers.push(
  new TelegramNotifier({
    /* ... */
  }),
);

// Use Slack only in production
if (process.env.NODE_ENV === "production") {
  notifiers.push(
    new SlackNotifier({
      /* ... */
    }),
  );
}

// Use Email for critical alerts
notifiers.push(
  new EmailNotifier({
    /* ... */
  }),
);

const monitor = new AIMonitor({ notifiers });

Error Handling

const monitor = new AIMonitor({
  notifiers: [
    new MultiNotifier({
      notifiers: [telegram, slack, email],
      stopOnFirstError: false, // Continue even if one fails
    }),
  ],
});

// If Slack fails, Telegram and Email still receive notifications

Custom Notifier

Create your own notifier:

import type { INotifier, IAlert } from "@momen124/ai-monitor-core";

class DiscordNotifier implements INotifier {
  constructor(private webhookUrl: string) {}

  async send(message: string): Promise<void> {
    await fetch(this.webhookUrl, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ content: message }),
    });
  }

  async sendAlert(alert: IAlert): Promise<void> {
    const message = `**${alert.severity}**: ${alert.title}\n${alert.message}`;
    await this.send(message);
  }

  // Implement other methods...
}

// Use it!
const monitor = new AIMonitor({
  notifiers: [new DiscordNotifier("YOUR_WEBHOOK")],
});

🔧 Troubleshooting

Telegram not sending messages

  1. Verify bot token is correct
  2. Ensure chat ID is correct (message the bot first)
  3. Check internet connectivity
  4. Install telegram package: npm install telegram

Slack webhook failing

  1. Verify webhook URL is correct and active
  2. Check Slack app permissions
  3. Install axios package: npm install axios

Email not sending

  1. Verify SMTP credentials
  2. Check firewall/port access (usually 587 or 465)
  3. For Gmail, use an App Password
  4. Install nodemailer package: npm install nodemailer

📖 Related Packages


📝 License

MIT © AKER Team


Made with ❤️ by the AKER Team