# tic-tac-mobile-js-sdk

> https://github.com/tictacmobile/tic-tac-js-sdk

Latest version **1.0.0** (published 2019-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install tic-tac-mobile-js-sdk
pnpm add tic-tac-mobile-js-sdk
yarn add tic-tac-mobile-js-sdk
bun add tic-tac-mobile-js-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-05-13 |
| First published | 2019-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 17.3 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nail Valeev |
| Maintainers | tictacmobile |

## Links

- npm: https://www.npmjs.com/package/tic-tac-mobile-js-sdk
- Repository: https://github.com/tictacmobile/tic-tac-js-sdk
- Homepage: https://github.com/tictacmobile/tic-tac-js-sdk#readme
- Issues: https://github.com/tictacmobile/tic-tac-js-sdk/issues
- npm.io page: https://npm.io/package/tic-tac-mobile-js-sdk

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.18.0
- [xml2js](https://npm.io/package/xml2js.md) ~0.4.16
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1
- [native-promise-only](https://npm.io/package/native-promise-only.md) ^0.8.1

## Recent versions

- 1.0.0 (latest) — 2019-05-13

## README

![npm](https://img.shields.io/badge/npm-1.2.0-green.svg)
# tic-tac-js-sdk
The Tic-Tac Mobile Software Development Kit for JavaScript designed to provide an easy interface to communicate with [Tic-Tac Mobile REST API](https://www.tictacmobile.com/api) in order to develop integrations with [Tic-Tac Mobile](https://www.tictacmobile.com). SDK relies on Promises to simplify handling of the asynchronous requests to the API endpoints.

# Features
* Make http requests from node.js
* Supports the Promise API
* Automatic converts response data from XML to JSON
* Descriptive error messages with status codes

# Installation
To use Tic-Tac Mobile JavaScript SDK, you need Node.js v6.4.0 or above.

`npm install tic-tac-js-sdk`

# Usage

To authorize the API calls, create the instance of APIConsumer. Pass you Tic-Tac Mobile API access token as parameter. You can use token saved as environment variable or pass it as argument on **npm start** :

`const token = process.env.API_TOKEN || args`

`const consumer = new APIConsumer(token)`

Then use any of available methods to call the API endpoints. SDK are Promise-based, so, it is easy to handle successful and failed requests:

`consumer.getUsers().then( // Handle data).catch( // Expose error)`

# Methods available
List of 27 methods available, grouped by endpoints they making calls to:
## users
* getUsers()
* getUser()
* addUser()
## projects
* getProjects()
* getProjectsWithBudget()
* getProjectsWithMembers()
* getProjectsWithBudgetAndMembers()
* addProject()
## utilizations
* getUtilizations()
## pricelists
* getPriceLists()
## invoices
* getInvoices()
* getInvoicesForProject()
## normaltimes
* getNormalTimes()
* getNormalTime()
## userreports
* getUsersReports()
* getOneUserReports()
## projectreports
* getProjectReports()
## timeplans
* getTimePlans()
* getTimePlansForProject()
* getUserTimePlans()
* getUserTimePlansForProject()
* getTimePlansSelected()
## entries
* getEntries()
* getEntriesWithBudget()
* getProjectEntries()
* getProjectEntriesWithBudget()
* addEntry()

# Sample app with Tic-tac Mobile JavaScript SDK, React.js, Next.js and Express.js
## Live demo:
https://cscloud153.lnu.se/
## Source code:
https://github.com/NailValeev/tic-tac-js-sample

---
_Source: https://npm.io/package/tic-tac-mobile-js-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
