@levma/timebutler-api-client
v0.1.6
Published
API client for Timbutler
Readme
Timebutler API
This is an API for the Timebutler service. It allows one to call the defined endpoints of Timebutler as described here.
Status
This client is not production ready! (Early beta stage and subject to change)
Installation
npm i timebutlar-api-clientConfiguation
Provide API keys in the .env file:
- TIMEBUTLER_API_KEY: needed for standard calls
- TIMEBUTLER_API_KEY_EXTENDED: optional, only needed for priviledged calls like salaries
Usage
In your Node project:
import { absences, createTimebutlerApiCaller } from "timebutler-api-client";
const apiKey = process.env.TIMEBUTLER_API_KEY;
const caller = createTimebutlerApiCaller(apiKey!);
const result = await absences(caller);Directly inside a html page (download client.js from
Releases):
<script src="client.js"></script>
<script>
const timebutler = globalThis["TimebutlerApi"];
const caller = timebutler.createTimebutlerApiCaller("a-timebutler-api-key");
const result = await timebutler.absences(caller);
</script>