tuitio-client/README.md

45 lines
1.8 KiB
Markdown

# Tuitio client
## Introduction
Tuitio client is an npm package written in typescript that facilitates the integration of a javascript application with [Tuitio](https://lab.code-rove.com/gitea/tudor.stanciu/tuitio).
## Package installation
The package installation can be done in two ways:
- from the command line: `npm install @flare/tuitio-client@1.0.0`
- from the package.json file: `"@flare/tuitio-client": "1.0.0"`
## How to use the package
```javascript!
const { TuitioClient, fetch } = require("@flare/tuitio-client");
const TuitioClient = require("@flare/tuitio-client");
const type { TuitioLoginResponse, TuitioLogoutResponse, TuitioState } = require("@flare/tuitio-client");
```
```javascript!
import { TuitioClient, fetch } from "@flare/tuitio-client";
import TuitioClient from "@flare/tuitio-client";
import type { TuitioLoginResponse, TuitioLogoutResponse, TuitioState } from "@flare/tuitio-client";
```
## Unit testing
Unit testing is done using [Jest](https://jestjs.io/). This is an awesome testing framework created by Facebook.
The files containing tests are identified by the extension `*.test.ts`.
All tests in the package can be executed by running: `npm test`.
## Changelog
1.0.0 - Package initialization
1.0.1 - Export Tuitio types
1.0.2 - Validate that Tuitio's URL parameter is a valid URL
1.0.3 - Added LICENSE file
1.0.4 - TuitioState's token property can be null
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented.
1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API.
1.2.1 - Added decodeToken function. The token is obtained directly by the function from local storage. If the token is missing, the function returns null.
1.2.2 - Upgraded @flare/js-utils package.