npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@timetac/js-client-library

v2.112.0

Published

TimeTac API JS client library

Readme

TimeTac Client Library

This library is a thin wrapper facilitating requests to the TimeTac REST API. For more information please visit the API documentation.

Installation

Use the package manager yarn or npm to install TimeTac Client Library.

Using yarn:

yarn add @timetac/js-client-library

Using npm:

npm install @timetac/js-client-library

Obtaining Access Credentials

Existing customers can activate API access or request access to a sandbox environment by contacting [email protected]. This process usually takes less than two business days and is currently free of charge.

If you are not a customer yet, you may set up a free trial and contact [email protected] to obtain a client_id and client_secret for your personal demo account.

Finally, if you just want to run a few requests, you may use the public API playground sandbox account. This account is reset to its initial state in regular intervals. Access credentials are available in the react playground's README.

Usage

import Api from "@timetac/js-client-library"
//Only account name is required.
const environment = {
  host: 'api.timetac.com',
  https?: boolean;
  account: <ACCOUNT_NAME>,
  version: 3,
  account?: string;
  accessToken?: string;
  refreshToken?: string;
  clientId?: string;
  clientSecret?: string;
  //Callback, called on refresh of the token. object of access token and refresh {accessToken, refreshTOken}  token are passed as parameter
  onTokenRefreshedCallback: (tokens) => console.log(`${tokens.accessToken} ${tokens.refreshToken}`),
  //Callback called when refresh of the token fails.
  onTokenRefreshFailed: () => { console.log('Intended action, such as logout')},
  //If true, it tries to refresh token on failed request. Default true.
  shouldAutoRefreshToken?: boolean;
  timeout?: number;
}

const authCredentials = {
  grant_type: 'password',
  client_id: <CLIENT_ID>,
  client_secret: <CLIENT_SECRET>,
  username: <USER_NAME>,
  password: <PASSWORD>
}

const api = new Api(environment);

async() => {
  await api.authentication.login(authCredentials);

  api.timeTrackings.read()
    .then({ Results }} => {
      console.log(Results)
    });

  api.users.readMe().then({ Results } => {
    console.log(Results);
  });

  api.absenceDays.read(
    new RequestParamsBuilder<AbsenceDay>()
    .eq('user_id', 1)
    .gteq('date', '2020-01-01')
    .build()
  );

  api.absenceDay.read({
    user_id: '1',
    date: '2020-01-01',
    _op__date: 'gteq'
  })
}

List of supported endpoints

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

The shortest, simplest way of running the test suite is the following command:

yarn test

License

Apache License 2.0

Troubleshooting

Cross-Origin Resource Sharing (CORS)

When experiencing issues with cross-origin resource sharing (CORS), you will have to configure a proxy server for development. This can be done, for example, with http-proxy-middleware. An example configuration for a React project can be found in the react playground.