@rootly/ts) is a type-safe client for the Rootly API. Types are generated directly from the OpenAPI specification, giving you full autocomplete and compile-time safety for every endpoint, parameter, and response.
Features
- Zero runtime overhead — types are generated at build time, not runtime
- Full type safety — every endpoint, parameter, and response is typed from the OpenAPI spec
- Tiny footprint —
openapi-fetchis ~6 KB and wraps the nativefetch - ESM and CommonJS — works in Node.js, Deno, Bun, and modern bundlers
- Typed errors — API error responses are typed per status code
Requirements
Any JavaScript runtime with a nativefetch implementation:
- Node.js 20+
- Deno, Bun, or modern bundlers (Vite, webpack, esbuild, etc.)
- Modern browsers
fetch polyfill via the fetch option (see Custom Fetch).
Installation
require:
Quick Start
Getting an API Key
- Log in to your Rootly account
- Navigate to Settings > API Keys
- Create a new API key with the permissions you need
Usage
List Incidents
Get an Incident
Create an Incident
Update an Incident
Error Handling
error is typed per status code (e.g. 401, 404), and data is typed with the endpoint’s response schema.
Using Types
Import generated schemas directly for DTOs, validation, or UI code:Configuration
Custom Base URL
Custom Fetch
Pass a customfetch implementation for testing, retries, or logging:
Advanced Usage
For direct access to the underlyingopenapi-fetch client with full type inference and middleware support:
Feedback & Support
- Package: @rootly/ts on npm
- Source Code: GitHub Repository
- Issues: GitHub Issues