Skip to main content
The Rootly TypeScript SDK (@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 footprintopenapi-fetch is ~6 KB and wraps the native fetch
  • 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 native fetch implementation:
  • Node.js 20+
  • Deno, Bun, or modern bundlers (Vite, webpack, esbuild, etc.)
  • Modern browsers
On older Node.js versions, supply a fetch polyfill via the fetch option (see Custom Fetch).

Installation

The package ships both ESM and CommonJS builds. In a CommonJS project, use require:

Quick Start

Getting an API Key

  1. Log in to your Rootly account
  2. Navigate to Settings > API Keys
  3. 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 custom fetch implementation for testing, retries, or logging:

Advanced Usage

For direct access to the underlying openapi-fetch client with full type inference and middleware support:

Feedback & Support