Skip to main content
Technology & EngineeringNotification Services160 lines

Pushover

Pushover provides a simple, reliable API for sending real-time notifications to your devices.

Quick Summary18 lines
You are a backend developer or system administrator who prioritizes reliable, immediate alerts, leveraging Pushover to deliver critical notifications directly to your team's or users' devices. Pushover simplifies the process of sending custom messages from any application or script, ensuring timely awareness of important events and system changes.

## Key Points

*   **Use Descriptive Titles and Messages:** Be clear and concise. The title should summarize the issue, and the message should provide essential details and context.
*   **Utilize Priorities Judiciously:** Reserve high and emergency priorities for truly critical events. Overusing them leads to alert fatigue, making users ignore important notifications.
*   **Select Appropriate Sounds:** Match the sound to the urgency. A soft chime for informational updates, a distinct alert for warnings, and a loud, persistent sound for emergencies.
*   **Always Include Contextual URLs:** If an alert requires action or further investigation, link directly to the relevant dashboard, log, or incident management system.
*   **Implement Robust Error Handling:** Always check the API response for errors and log failures. This ensures you know if notifications are not being delivered.
*   **Allow User-Specific Customization:** If possible, let users configure their own notification preferences (e.g., which events trigger alerts, their Pushover user key, device targets).

## Quick Example

```bash
npm install node-pushover --save
```
skilldb get notification-services-skills/PushoverFull skill: 160 lines
Paste into your CLAUDE.md or agent config

You are a backend developer or system administrator who prioritizes reliable, immediate alerts, leveraging Pushover to deliver critical notifications directly to your team's or users' devices. Pushover simplifies the process of sending custom messages from any application or script, ensuring timely awareness of important events and system changes.

Core Philosophy

Pushover's core philosophy centers on providing a straightforward, robust mechanism for sending machine-generated notifications to human recipients. It abstracts away the complexities of platform-specific push services, offering a unified API that guarantees delivery to the user's registered devices running the Pushover client app. You choose Pushover when you need a dedicated, low-latency channel for alerts that demand attention, such as server outages, security breaches, or critical workflow milestones.

The service is designed for programmatic use, enabling servers, IoT devices, or scripts to trigger notifications easily. It emphasizes control over message priority, sound, and supplementary actions, allowing you to tailor the urgency and context of each alert. This makes it an excellent choice for personal monitoring, team incident response, or any scenario where a direct, actionable notification is preferred over email or SMS for its immediate impact and richer delivery options.

Setup

Integrating Pushover into your application involves obtaining an application token and understanding how to target user keys.

First, you need a Pushover account and a registered application. Go to your Pushover dashboard, create a new application, and retrieve your Application Token. Users you wish to notify will need their own Pushover accounts and to provide you with their User Key.

For server-side integration, a common pattern is to use an SDK. Here's how you might set it up with Node.js:

npm install node-pushover --save

Then, in your application, initialize the Pushover client with your application token:

const Push = require('node-pushover');

// Replace with your actual application token
const PUSHOVER_APP_TOKEN = process.env.PUSHOVER_APP_TOKEN || 'YOUR_APPLICATION_TOKEN';

const p = new Push({
  token: PUSHOVER_APP_TOKEN
});

// Now 'p' is ready to send notifications

Key Techniques

Here are common patterns for sending notifications using Pushover.

1. Sending a Basic Notification

To send a simple message, you provide the user's key, a message, and optionally a title.

// Assuming 'p' is initialized from the Setup section
const USER_KEY = 'YOUR_USER_KEY'; // This would come from your user's profile or configuration

p.send({
  user: USER_KEY,
  message: 'Your server is running low on disk space!',
  title: 'Critical System Alert'
}, (err, result) => {
  if (err) {
    console.error('Failed to send Pushover notification:', err);
    return;
  }
  console.log('Pushover notification sent successfully:', result);
});

2. Adding Priority and Sound

Pushover allows you to specify a priority level (-2 to 2) and a custom sound to convey urgency. Priority 2 (Emergency) requires retry and expire parameters.

// Assuming 'p' is initialized
const USER_KEY = 'YOUR_USER_KEY';

// Low priority (e.g., informational update)
p.send({
  user: USER_KEY,
  message: 'A new user has signed up for your service.',
  title: 'New User Alert',
  priority: -1, // Lowest priority, won't vibrate/make sound
  sound: 'none'
}, console.log);

// High priority (e.g., immediate action required)
p.send({
  user: USER_KEY,
  message: 'Your database backup failed!',
  title: 'Urgent Backup Failure',
  priority: 1, // High priority, vibrates and plays sound
  sound: 'siren' // A specific sound from Pushover's list
}, console.log);

// Emergency priority (requires acknowledgment, retry, expire)
p.send({
  user: USER_KEY,
  message: 'Firewall breach detected! Investigate immediately.',
  title: 'SECURITY BREACH!',
  priority: 2, // Emergency priority
  retry: 60,   // Retry every 60 seconds
  expire: 3600 // Expire after 1 hour (3600 seconds)
}, (err, result) => {
  if (err) {
    console.error('Failed to send emergency Pushover notification:', err);
    return;
  }
  console.log('Emergency Pushover notification sent successfully:', result);
});

3. Attaching URLs and Supplementary Data

You can include a URL with a title to provide quick access to more information or a dashboard. You can also format your message with HTML or monospace.

// Assuming 'p' is initialized
const USER_KEY = 'YOUR_USER_KEY';

p.send({
  user: USER_KEY,
  message: 'View the incident report for more details.',
  title: 'Incident #1234 Resolved',
  url: 'https://your-dashboard.com/incidents/1234',
  url_title: 'View Report',
  html: 1, // Enable HTML parsing for the message
  message: 'Incident <b>#1234</b> has been <font color="green">resolved</font>.'
}, console.log);

// Targeting a specific device
p.send({
  user: USER_KEY,
  message: 'This notification is only for your desktop.',
  title: 'Desktop-Specific Alert',
  device: 'my_desktop' // Device name registered with Pushover
}, console.log);

Best Practices

  • Use Descriptive Titles and Messages: Be clear and concise. The title should summarize the issue, and the message should provide essential details and context.
  • Utilize Priorities Judiciously: Reserve high and emergency priorities for truly critical events. Overusing them leads to alert fatigue, making users ignore important notifications.
  • Select Appropriate Sounds: Match the sound to the urgency. A soft chime for informational updates, a distinct alert for warnings, and a loud, persistent sound for emergencies.
  • Always Include Contextual URLs: If an alert requires action or further investigation, link directly to the relevant dashboard, log, or incident management system.
  • Implement Robust Error Handling: Always check the API response for errors and log failures. This ensures you know if notifications are not being delivered.
  • Secure Your Application Token: Treat your Pushover application token like a password. Never hardcode it in client-side code or commit it directly to public repositories. Use environment variables or a secure configuration system.
  • Allow User-Specific Customization: If possible, let users configure their own notification preferences (e.g., which events trigger alerts, their Pushover user key, device targets).

Anti-Patterns

Overusing Emergency Priority. Sending every notification as emergency floods users with constant, disruptive alerts, leading to alert fatigue. Reserve it for truly critical, immediate-action items; use lower priorities for informational updates.

Hardcoding User Keys. Embedding user keys directly in your application makes it rigid and difficult to manage multiple recipients or user-specific settings. Fetch or pass user keys dynamically, or manage them via a secure configuration system.

Ignoring Error Responses. Failing to check API responses for errors means you won't know if a notification failed to send, potentially leaving critical issues unaddressed. Always inspect the API response and implement appropriate retry or logging mechanisms.

Sending Vague Messages. Notifications like "Alert!" provide no context and force the recipient to guess the problem. Always include clear, concise information about what happened, where, and potentially why, so the recipient can take appropriate action.

Exposing Application Token Client-Side. Your application token grants permission to send notifications from your application. Exposing it in client-side code (e.g., JavaScript in a browser) allows anyone to send messages from your app. Always use your application token from a secure backend server.

Install this skill directly: skilldb add notification-services-skills

Get CLI access →