A fully-typed TypeScript client for every DecentroHR action.
@decentrohr/sdk is the official, fully-typed client. It ships zero runtime dependencies and covers every action — the action argument autocompletes to all 255, with per-action input and result types generated from the live API.
npm install @decentrohr/sdkimport { DecentroHR } from "@decentrohr/sdk"; const dhr = new DecentroHR({ baseUrl: "https://api.decentrohr.com", token: process.env.DECENTROHR_TOKEN!, }); const run = await dhr.payroll.createRun({ companyId, periodStart, periodEnd }); await dhr.payroll.calculate({ runId: run.id }); await dhr.payroll.finalize({ runId: run.id }, { idempotencyKey: `finalize:${run.id}` });
Beyond the payroll helpers, call() reaches any action with full typing:
const emp = await dhr.call("employee.create", { firstName, lastName, email }); const runs = await dhr.call("payroll.listRuns", { companyId });
Non-2xx responses throw a typed DecentroApiError with helpers like isEntitlement (402), isForbidden (403) and isIdempotencyConflict (409).
Pass { idempotencyKey } on any mutating call; construct the client with { sandbox: true } to run against test data. The package also ships the OpenAPI contract so you can generate exact types for your own tooling.
The SDK is the same contract the DecentroHR AI calls — nothing is bolted on for partners.