Skip to content

Repository files navigation

uptime-robot-v3

npm CI license node TypeScript

Community-maintained TypeScript client for the Uptime Robot REST API v3. The API surface follows the official docs; this package is not affiliated with, endorsed by, or supported by UptimeRobot.

Resource methods live on UptimeRobotService (monitors, public status pages, maintenance windows, and more). The repo runs tests and a production build on every push via GitHub Actions.

Runtime: Node.js 18+ (ESM only: import / import()).

Install

npm install uptime-robot-v3

Dependencies: HTTP via axios, multipart via form-data, and image-size for validating PSP logo/icon files on disk.

Quick start

import { UptimeRobotService } from 'uptime-robot-v3';

const service = new UptimeRobotService({ apiKey: process.env.UPTIMEROBOT_API_KEY! });

const monitors = await service.monitors.list();

Types

Public API types are exported from the package root:

import type { Monitor, Config, MonitorPayload } from 'uptime-robot-v3';

Optional diagnostic logging

By default the client does not write to console. Pass a logger on Config to record API failures or retry-related messages from helpers like executeInBatches:

const service = new UptimeRobotService({
  apiKey: '...',
  logger: (message, level) => {
    if (level === 'error') console.error(message);
    else console.warn(message);
  },
});

Tools and utilities

  • service.toolsUptimeRobotTools (e.g. buildUtcCalendarDayRanges for uptime stats date ranges).
  • RequestTracker — module-level counter incremented once per HTTP call from RequestClient (JSON and multipart). It is not thread-isolated; call RequestTracker.reset() in tests or between jobs if you rely on the count.
  • executeInBatches — batch async work with optional progress logging and retries (see JSDoc).

Node-only: PSP images

Methods that accept PSP logo / icon paths read the file with Node fs and validate size and dimensions. That path is intended for Node scripts, not browsers.

Documentation

License

ISC

Releases

Contributors

Languages