FlexHrmApiClient is a Flex HRM API client for NodeJS. It is a wrapper around an API client that has been automatically generated with swagger-typescript-api from the Flex HRM OpenAPI specification.
Install the package:
npm install @rantalainen/flexhrm-api-client
import { FlexHrmApiClient } from '@rantalainen/flexhrm-api-client';The client uses Flex HRM API username/password credentials and sends them with HTTP Basic authentication.
const client = new FlexHrmApiClient(
{
username: process.env.FLEXHRM_USERNAME,
password: process.env.FLEXHRM_PASSWORD
},
{
baseURL: 'https://internhrm.klaraconsulting.se/webapi'
}
);Do not include /api in baseURL; generated methods already include /api/... in their paths.
All generated operations are available under the api namespace. Responses follow Axios conventions, so the payload is in response.data.
const response = await client.api.companiesList({ pageSize: 10 });
console.log(response.data.result);The generated Api class and data types are also exported for advanced use.
- Flex HRM API base URL: https://internhrm.klaraconsulting.se/webapi