All Projects → TimeTac → js-client-library

TimeTac / js-client-library

Licence: Apache-2.0 license
TimeTac Client Library is a thin wrapper for client to make api request.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to js-client-library

Google Maps Services Java
Java client library for Google Maps API Web Services
Stars: ✭ 1,497 (+13509.09%)
Mutual labels:  client-library
Php Sparkpost
SparkPost client library for PHP
Stars: ✭ 190 (+1627.27%)
Mutual labels:  client-library
iyzipay-dotnet-client
iyzipay api .net framework and .net core client
Stars: ✭ 30 (+172.73%)
Mutual labels:  client-library
Xmlrpc
Implementation of XMLRPC protocol in Go language.
Stars: ✭ 133 (+1109.09%)
Mutual labels:  client-library
Docker Java
Java Docker API Client
Stars: ✭ 2,166 (+19590.91%)
Mutual labels:  client-library
Iyzipay Php
iyzipay api php client
Stars: ✭ 205 (+1763.64%)
Mutual labels:  client-library
Google Api Nodejs Client
Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.
Stars: ✭ 9,722 (+88281.82%)
Mutual labels:  client-library
ably-cocoa
iOS, tvOS and macOS Objective-C and Swift client library SDK for Ably realtime messaging service
Stars: ✭ 33 (+200%)
Mutual labels:  client-library
Node Sparkpost
SparkPost client library for Node.js
Stars: ✭ 177 (+1509.09%)
Mutual labels:  client-library
java-binance-api
Java Binance API Client
Stars: ✭ 72 (+554.55%)
Mutual labels:  client-library
Gitlabapiclient
GitLab API client
Stars: ✭ 138 (+1154.55%)
Mutual labels:  client-library
Go Nsq
The official Go package for NSQ
Stars: ✭ 2,045 (+18490.91%)
Mutual labels:  client-library
Alpaca
Given a web API, Generate client libraries in node, php, python, ruby
Stars: ✭ 2,447 (+22145.45%)
Mutual labels:  client-library
Iyzipay Node
iyzipay api node.js client
Stars: ✭ 116 (+954.55%)
Mutual labels:  client-library
kubernetes-client-lambda
one-line kubernetes client: light-weight, lambda-styled, easy-testing. For a simplified kubernetes programming.
Stars: ✭ 47 (+327.27%)
Mutual labels:  client-library
Ably Js
Javascript, Node, Typescript client library SDK for Ably realtime messaging service
Stars: ✭ 99 (+800%)
Mutual labels:  client-library
Google Maps Services Js
Node.js client library for Google Maps API Web Services
Stars: ✭ 2,432 (+22009.09%)
Mutual labels:  client-library
ably-php
PHP client library SDK for Ably realtime messaging service
Stars: ✭ 41 (+272.73%)
Mutual labels:  client-library
streamr-client-javascript
JS library for interacting with Streamr APIs: publishing and subscribing to data, creating streams, etc.
Stars: ✭ 35 (+218.18%)
Mutual labels:  client-library
Jreactive 8583
Java Client & Server for ISO8583 & Netty
Stars: ✭ 248 (+2154.55%)
Mutual labels:  client-library

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: 'go.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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].