s-private API Documentation - v3.8.1
    Preparing search index...

    Interface for notification service implementations.

    Defines the contract for sending notifications at different priority levels. Each method enriches the message with context information and sends it with an appropriate priority level.

    Priority levels:

    • Error: High priority (1) - immediate attention required
    • Warning: Normal priority (0) - standard notification
    • Info: Low priority (-1) - informational only
    const service: NotificationService = createPushoverService(config);

    // Error notifications are high priority
    await service.notifyError("Critical failure", { caller: "PaymentService" });

    // Warning notifications are normal priority
    await service.notifyWarning("Slow response time", { caller: "APIMonitor" });

    // Info notifications are low priority
    await service.notifyInfo("Daily report generated", { caller: "ReportService" });
    type NotificationService = {
        notifyError(
            message: string,
            context: NotificationContext,
        ): Promise<void>;
        notifyInfo(message: string, context: NotificationContext): Promise<void>;
        notifyWarning(message: string, context: NotificationContext): Promise<void>;
    }
    Index

    Methods