The Pushover API configuration
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:
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"
});
Creates a new Pushover notification service instance.