@oncallsh/sdk
v0.0.2
Published
TypeScript SDK for the oncall.sh API by beeps.
Readme
@oncallsh/sdk
TypeScript SDK for the oncall.sh API by beeps.
Sign up at oncall.sh
- Documentation: Full documentation site
Install
pnpm add @oncallsh/sdk
Basic Usage
import { OnCallClient } from "@oncallsh/sdk";
const oncall = new OnCallClient({
apiKey: process.env.ONCALL_API_KEY!
});
const relay = await oncall.relay.create({
name: "mycompany primary on-call relay",
description: "this is our primary rotation",
externalKey: "mycompany::relay::primary"
});Errors
By default methods throw typed errors (AuthError, ValidationError, NotFoundError, RateLimitError, ServerError, NetworkError, HttpError). Use the safe variants to avoid try/catch:
const { data, error } = await oncall.relay.createSafe({...});
