s-private API Documentation - v3.8.1
    Preparing search index...
    • Creates a new Pushover notification service instance.

      Parameters

      Returns NotificationService

      A NotificationService instance configured for Pushover

      Factory function for creating a NotificationService implementation that uses the Pushover API for sending push notifications.

      The service enriches messages with context information and sends notifications with appropriate priority levels:

      • Error: Priority 1 (high) - triggers immediate notification
      • Warning: Priority 0 (normal) - standard notification
      • Info: Priority -1 (low) - silent notification
      import { createPushoverService } from "@s-hirano-ist/s-notification";

      const notificationService = createPushoverService({
      url: "https://api.pushover.net/1/messages.json",
      userKey: process.env.PUSHOVER_USER_KEY,
      appToken: process.env.PUSHOVER_APP_TOKEN
      });

      // Use the service to send notifications
      await notificationService.notifyError("Server crash detected", {
      caller: "HealthCheck",
      userId: "admin"
      });