JavaScript SDK
Needs updating
A JavaScript SDK to easily interact with the Oh Dear API from your Node.js or browser applications.
The JavaScript SDK provides a convenient way to interact with the Oh Dear API from Node.js applications. Built and maintained by the community, it offers full access to Oh Dear's monitoring capabilities.
Installation #
npm install ohdear-js-sdk
Features #
The SDK supports all major Oh Dear API operations:
- Site Management: List, retrieve, create, and delete monitored websites
- Check Operations: Enable/disable health checks and request immediate check runs
- Uptime Monitoring: Retrieve uptime percentages across configurable time periods
- Downtime Tracking: Identify outage windows within specified date ranges
- Link Validation: Detect broken links across monitored sites
- Security Audits: Check for mixed content issues and SSL certificate health
Usage #
import OhDear from 'ohdear-js-sdk' const ohdear = new OhDear('your-api-token') // Get all sites const sites = await ohdear.sites() // Get uptime data const uptime = await ohdear.uptime(siteId, startDate, endDate, 'day') // Check SSL certificate health const cert = await ohdear.certificateHealth(siteId)
For more details, see the GitHub repository.