2.0.0 • Published 7 months ago

wakatimejs v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

WakaTimeJS

Type safe JavaScript client for the WakaTime REST API

Installation

npm install wakatimejs

or

yarn add wakatimejs

Usage

consumption is super straight forward, just import the class and instantiate it with your api key.

import { WakaTime } from "wakatimejs"; // or const { WakaTime } = require('wakatimejs');

const wakaTime = new WakaTime("your-api-key");

wakaTime.users.current().then((user) => {
	console.log(user);
});

Alternatively, if you don't have access to the api key at the time of instantiation, you can use the setApiKey method.

import { WakaTime } from "wakatimejs";

const wakatime = new WakaTime();

// ... later on

wakaTime.setApiKey("your-api-key");

wakaTime.users.current().then((user) => {
	console.log(user);
});

API

The API follows the samme nameing convention for the endpoints as the REST API.

some of the routes in the REST API require a user id or authentication, but these are handled by the client, so you don't have to worry about them.

2.0.0

7 months ago

1.1.0

11 months ago

1.0.0

11 months ago