Official auto-generated SDKs for the Factorial API, available for TypeScript and Python.
Both SDKs are generated from the OpenAPI spec and wrapped with a generated FactorialClient providing clean domain-namespaced access and cursor pagination helpers.
npm install @factorialco/api-clientimport { FactorialClient } from "@factorialco/api-client";
const client = new FactorialClient({ apiKey: process.env.FACTORIAL_API_KEY });
const page = await client.employees.employees.list();
for await (const emp of client.employees.employees.paginate({ maxItems: 50 })) {
console.log(emp.full_name);
}pip install factorial-api-clientfrom factorial_api_client import FactorialClient
client = FactorialClient(api_key="YOUR_KEY")
result = client.employees.employee.list()
for emp in client.employees.employee.paginate(max_items=50):
print(emp.full_name)Both SDKs use standard semver (MAJOR.MINOR.PATCH), independent of the Factorial API version date.
| SDK version | Factorial API version |
|---|---|
1.x.y |
2026-04-01 |
Factorial releases new API versions quarterly (Jan/Apr/Jul/Oct). To release a new SDK version:
- Run the release script in the relevant SDK directory.
- Enter the API version date (
yyyy-mm-dd) when prompted. - The script fetches the spec from
https://api.factorialhr.com/oas/?version=<date>, regenerates all generated code, and bumps the semver (--bump major|minor|patch, defaultpatch). - After building, it asks whether to publish — answer
yto push to npm/PyPI ornto skip.
See the per-SDK READMEs for full instructions: TypeScript · Python
Generate SDK from latest spec
cd typescript
npm run generateFetches the OpenAPI spec from https://api.factorialhr.com/oas/?version=<date> and regenerates all src/generated/*.gen.ts files. Override the URL with:
OPENAPI_SPEC_URL=./local-spec.json npm run generateTest against the live API
FACTORIAL_API_KEY=your_key npm run test:api
# or with OAuth token:
FACTORIAL_OAUTH_TOKEN=your_token npm run test:apiRelease a new version
npm run release # patch bump (default)
npm run release -- --bump minor # minor bump
npm run release -- --bump major # major bump
npm run release:dry-run # preview only — no writes, no publishThe release script:
- Prompts for the API version date (
yyyy-mm-dd). - Fetches the spec from
https://api.factorialhr.com/oas/?version=<date>. - Regenerates
src/generated/(stage 1) andsrc/sdk.ts(stage 2). - Bumps the SDK semver (
--bump major|minor|patch, defaultpatch). - Builds the package, then asks whether to publish to npm.
Both SDKs support:
- API key — via
apiKey:/api_key=(sent asx-api-keyheader) - OAuth2 bearer token — via
token:/token=(sent asAuthorization: Bearer)