Type-safe TypeScript SDK for Servarr APIs (Radarr, Sonarr, etc.)
npm install tsarrTypeScript-arr (pronounced "Tsar" /tsɑr/ - a Slavic king/emperor)




Type-safe TypeScript SDK for Servarr APIs (Radarr, Sonarr, etc.)
Tsarr provides type-safe TypeScript clients for all Servarr APIs, generated from their Swagger/OpenAPI specifications. Perfect for building automation tools, scripts, and applications to manage your media servers.
- 🛡️ Type-safe - Generated from official Swagger/OpenAPI specs
- ⚡ Bun-optimized - Leverages native fetch API
- 📦 Modular - Separate clients for each Servarr app
- Radarr - Movie collection manager
- Sonarr - TV series collection manager
- Lidarr - Music collection manager
- Readarr - Book collection manager
- Prowlarr - Indexer manager
``bash`
bun add tsarr
`typescript
import { RadarrClient, SonarrClient, LidarrClient } from 'tsarr';
const radarr = new RadarrClient({
baseUrl: 'http://localhost:7878',
apiKey: 'your-api-key'
});
// Type-safe API calls
const movies = await radarr.getMovies();
const status = await radarr.getSystemStatus();
`
Install dependencies:
`bash`
bun install
Run development server:
`bash`
bun run dev
Build the project:
`bash`
bun run build
Lint and format:
`bash``
bun run lint
bun run format
- API Documentation - Auto-generated TypeScript API docs
- Usage Guide - Complete usage documentation with examples
- Examples - Real-world automation examples
- Examples Directory - Runnable example scripts
Perfect for building:
- Automation scripts - Bulk movie imports, library maintenance, and media organization
- Management tools - Custom dashboards, backup utilities, and monitoring scripts
- Integration scripts - Connect Servarr apps with other services and workflows
- CLI tools - Command-line utilities for media server administration
This project uses:
- Bun as the JavaScript runtime
- Biome for linting and formatting
- @hey-api/openapi-ts for code generation
- Renovate for dependency updates
MIT - see LICENSE file for details.