OptionalemergencyOpts?: { callback?: string; expire: number; retry: number; tags?: string[] }Emergency priority options, required when priority is 2.
Optionalcallback?: stringAn optional callback URL that Pushover servers will send a request to when the notification has been acknowledged.
Specifies how long (in seconds) the notification will continue to be resent. Maximum value is 10800 seconds (3 hours).
Specifies how often (in seconds) the Pushover servers will send the same notification to the user. Minimum value is 30 seconds.
Optionaltags?: string[]Optional tags for emergency notifications. Helps with cancelling retries.
Optionalhtml?: booleanIf set to true, the message content will be treated as HTML.
Mutually exclusive with monospace.
Optionallink?: string | { title?: string; url: string }An optional link attached to the message. Can be either a simple URL string or an object containing the URL and an optional display title.
The message content sent to the user. Must be at least 3 characters long.
Optionalmonospace?: booleanIf set to true, the message content will be displayed using a monospace font.
Mutually exclusive with html.
Optionalpriority?: 0 | 1 | 2 | -2 | -1Sets the notification priority for the message. Defaults to 0 (normal priority).
emergencyOpts.Optionalsound?: stringThe name of one of the predefined Pushover sounds or a custom sound uploaded by the user to be played for the notification.
Optionaltimestamp?: numberAn optional Unix timestamp representing the message's date and time to display to the user, rather than the time Pushover received it.
Optionaltitle?: stringAn optional title for the message.
Optionalttl?: numberTime To Live in seconds. Specifies how long the message will be kept until disappearing.
import type { PushoverMessage } from '@cis-oss/pushover';
const standardMessage: PushoverMessage = {
message: "Deployment successful!",
title: "Server Update",
priority: 1, // High priority
sound: "pushover",
link: {
url: "https://example.com/deployment/status",
title: "View Status"
}
};
const emergencyMessage: PushoverMessage = {
message: "System critical: Service down!",
priority: 2,
emergencyOpts: {
retry: 60, // Retry every 60 seconds
expire: 3600, // Expire after 1 hour
tags: ["critical", "infra"]
},
};
Defines the structure for a Pushover message object used when calling the
sendmethod.This type represents the complete set of parameters you can provide for a Pushover notification. It includes the required
messagefield and various optional fields to customize the notification's appearance, behavior, priority, sound, and delivery options.Refer to the official Pushover API documentation for detailed explanations of each field. Note the specific constraints:
emergencyOptsmust be provided ifpriorityis set to2.htmlandmonospaceformatting options cannot be used together.