2023-02-15 01:16:59 +02:00
# Tuitio client react
2023-02-11 05:11:27 +02:00
## Introduction
2023-02-15 01:16:59 +02:00
Tuitio client react is an npm package written in typescript that facilitates the integration of a react application with [Tuitio ](https://lab.code-rove.com/gitea/tudor.stanciu/tuitio ).
2023-02-11 05:11:27 +02:00
2023-02-11 22:34:16 +02:00
This package uses [tuitio-client ](https://lab.code-rove.com/gitea/bricks/tuitio-client#readme ) internally and adds state management through react contexts and various react hooks through which the user has access to data and actions.
2023-02-11 05:11:27 +02:00
## Package installation
The package installation can be done in two ways:
2023-02-15 01:16:59 +02:00
- from the command line: `npm install @flare/tuitio-client-react@1.0.0`
- from the package.json file: `"@flare/tuitio-client-react": "1.0.0"`
2023-02-11 05:11:27 +02:00
## How to use the package
2023-02-11 22:34:16 +02:00
```javascript!
2023-02-15 01:16:59 +02:00
const { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } = require("@flare/tuitio-client-react");
const TuitioProvider = require("@flare/tuitio-client-react");
2023-02-11 22:34:16 +02:00
```
```javascript!
2023-02-15 01:16:59 +02:00
import { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken } from "@flare/tuitio-client-react";
import TuitioProvider from "@flare/tuitio-client-react";
2023-02-11 22:34:16 +02:00
```
2023-02-11 05:11:27 +02:00
## Unit testing
2023-02-11 22:34:16 +02:00
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` .
2023-02-11 05:11:27 +02:00
All tests in the package can be executed by running: `npm test` .
## Changelog
2023-03-02 19:39:02 +02:00
1.0.0 - Package initialization
2023-03-18 02:24:30 +02:00
1.0.1 - Added useTuitioClient default options
2023-03-18 17:19:53 +02:00
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented
2023-03-29 18:17:30 +03:00
1.1.1 - Account logout bug fix
1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API and the latest changes published by "@flare/tuitio-client".