angusfretwell / toggl-got

Convenience wrapper for `got` to interact with the Toggl API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toggl-got

Travis Code Climate Codecov NPM Version NPM Downloads

Convenience wrapper for got to interact with the Toggl API

Install

$ npm install --save toggl-got

Usage

import toggl from 'toggl-got';

toggl('me', { token: 'foo' }).then(res => {
  console.log(res.body.data.fullname);
  //=> 'Angus'
});

API

Same as got (including the stream API and aliases), but with some additional options:

  • token

    Toggl API token.

    Can be set globally with the TOGGL_TOKEN environment variable.

  • endpoint

    Default: https://www.toggl.com/api/v8/

    Can be set globally with the TOGGL_ENDPOINT environment variable.

License

The MIT License (MIT)

Copyright (c) 2016 Angus Fretwell

About

Convenience wrapper for `got` to interact with the Toggl API

License:MIT License


Languages

Language:JavaScript 100.0%