@rantalainen/flexhrm-api-client
v1.0.0
Published
Node.js client for the Flex HRM API.
Maintainers
Keywords
Readme
flexhrm-api-client
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.
Installation
Install the package:
npm install @rantalainen/flexhrm-api-clientImport
import { FlexHrmApiClient } from '@rantalainen/flexhrm-api-client';Setup client with options
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.
Calling endpoints
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.
Resources
- Flex HRM API base URL: https://internhrm.klaraconsulting.se/webapi
