{"id":24044426,"url":"https://github.com/jimleuk/uptimerobot-js","last_synced_at":"2025-06-28T13:34:46.404Z","repository":{"id":44018213,"uuid":"231992766","full_name":"jimleuk/uptimerobot-js","owner":"jimleuk","description":"An unofficial node/browser javascript sdk for the Uptimerobot API written in Typescript","archived":false,"fork":false,"pushed_at":"2023-01-05T04:54:05.000Z","size":2174,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T09:06:36.501Z","etag":null,"topics":["api","client","typescript","uptimerobot"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimleuk.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T00:04:22.000Z","updated_at":"2021-10-24T16:37:07.000Z","dependencies_parsed_at":"2023-02-03T10:30:49.784Z","dependency_job_id":null,"html_url":"https://github.com/jimleuk/uptimerobot-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimleuk%2Fuptimerobot-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimleuk%2Fuptimerobot-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimleuk%2Fuptimerobot-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimleuk%2Fuptimerobot-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimleuk","download_url":"https://codeload.github.com/jimleuk/uptimerobot-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240822608,"owners_count":19863302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","client","typescript","uptimerobot"],"created_at":"2025-01-08T23:06:39.139Z","updated_at":"2025-02-26T08:44:52.332Z","avatar_url":"https://github.com/jimleuk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uptimerobot-js\n\nThe **Uptimerobot-js** is an unofficial node/browser javascript sdk for the Uptimerobot API written in Typescript.\n\n**Note**: When using in the browser, please remember that your API Key will likely be exposed. It is therefore recommended that only the monitor-specific api key is used in this instance.\n\n**Note**: This software is not affliated with Uptime Robot Service Provider Ltd. Issues and/or support should relating to this library be directed to the project's [issue tracker](https://github.com/jimleuk/uptimerobot-js/issues).\n\n## Installation\n```\nnpm i uptimerobot-js --save\n\n// or\n\nyarn add uptimerobot-js\n```\n## Usage\nThe library is written in Typescript but compiled to vanilla JS so can be used in non-typescript supported environments such as the browser.\nWith Typescript however, developers can take full advantage of the library's comprehensive types and enums for safety.\n\n\n```typescript\nimport Uptimerobot, { MonitorType } from 'uptimerobot-js'\nconst uptimerobot = new Uptimerobot('api_key...')\n\n// getting a list of monitors by ID\nconst { monitors } = await uptimerobot.monitor.get({\n  monitors: [0, 1, 2]\n})\n\n// create a Monitor with type of \"all\"\nconst response = await uptimerobot.monitor.create({\n  // here, we can use the enum MonitorType provided by the library\n  type: MonitorType.https,\n})\n```\n\n## Why this library?\n\nThe official Uptimerobot API is interesting to say the least. It prefers a custom delimited string convention over standard objects for requests.\nTake for example the following parameter for alert contacts when creating a new monitor.\n```\nalert_contacts: '457_0_0-373_5_0-8956_2_3'\n```\n\n\u003e **From the official documentation**: ...where alert_contact\u003eids are seperated with - and threshold + recurrence are seperated with _. For ex: alert_contacts=457_5_0 refers to 457 being the alert_contact\u003eid, 5 being the threshold and 0 being the recurrence...\n\n**Uptimerobot-js** has painstakingly changed all the occurences and handles the conversion between this delimited string format and a developer-friendly interface using objects. The development experience improves drastically because there is no longer the need to keep referring back to the official docs, writing your own utility functions and developers can fully take advantage of the typings.\n\nThis is how the library handles the above:\n```\nalert_contacts: [\n  { id: 457, threshold: 0, recurrence: 0 },\n  { id: 373, threshold: 5, recurrence: 0 },\n  { id: 8956, threshold: 2, recurrence: 3 },\n]\n\n// when the requests goes to the server, we convert this to `457_0_0-373_5_0-8956_2_3`\n```\n\nThis conversion is not exclusive for requests, it also happens with responses. When the api sends back delimited format strings, this library will handle the conversion automatically.\n\n\n## Configuration\nThe library is built on top of the [Axios](https://github.com/axios/axios) http library and exposes its complete config to be overwritten when the library is initialized.\n\nFor full config options, please refer to https://github.com/axios/axios#request-config\n```typescript\nconst uptimerobot = new Uptimerobot('api_key...', {\n  // eg. point to a dev server\n  baseUrl: 'http://localhost:3000',\n  // eg. increase timeout to 5 secs\n  timeout: 5e3,\n})\n```\n\n## Documentation\n\nAPI documentation for this library is a TODO. Here is a high level view of the class object and available methods.\n```\nUptimerobot {\n  account\n    list\n  monitor\n    get\n    list\n    create\n    update\n    delete\n    reset\n  alertContact\n    get\n    list\n    create\n    update\n    delete\n  mWindow\n    get\n    list\n    create\n    update\n    delete\n  psp\n    get\n    list\n    create\n    update\n    delete\n}\n```\n## Related\n\n* [Official Uptimerobot API documentation](https://uptimerobot.com/api)\n* [Unofficial Uptimerobot openAPI 3.0 documentation](https://github.com/jimleuk/uptimerobot-swagger)\n* [Unofficial Uptimerobot API typescript type defintions only](https://github.com/jimleuk/uptimerobot-types)\n\n## Licence\n\nMIT\n\n## Donate\n\nA random charity appears!\n\n**[Stamma](https://stamma.org)**  \nThe British Stammering Association, trading as Stamma is dedicated to creating a world where people who stammer are able to fulfil their potential and enjoy respect and consideration.\n\n**Org**: British Stammering Association trading as Stamma, reg. charity no. 1089967/SCO38866  \n**Donate**: https://stamma.org/join-us/donate-fundraise/donate\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimleuk%2Fuptimerobot-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimleuk%2Fuptimerobot-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimleuk%2Fuptimerobot-js/lists"}