tuitio-client-react/README.md

48 lines
2.1 KiB
Markdown
Raw Normal View History

2023-02-15 01:16:59 +02:00
# Tuitio client react
## 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).
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.
## 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"`
## How to use the package
```javascript!
const { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken, useTuitioUserInfo } = require("@flare/tuitio-client-react");
const TuitioProvider = require("@flare/tuitio-client-react");
```
```javascript!
import { TuitioProvider, useTuitioClient, useTuitioUser, useTuitioToken, useTuitioUserInfo } from "@flare/tuitio-client-react";
2023-02-15 01:16:59 +02:00
import TuitioProvider from "@flare/tuitio-client-react";
```
## 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
2023-04-09 13:35:35 +03:00
1.0.0 - Package initialization.
1.0.1 - Added useTuitioClient default options.
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented.
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".
1.2.1 - Added decodedToken in useTuitioToken hook. The token is obtained directly from TuitioProvider's react context.
1.2.2 - Upgraded @flare/tuitio-client and @flare/js-utils packages.
2023-04-04 08:59:01 +03:00
1.2.3 - User roles were handled in useTuitioUserInfo hook.
2023-04-09 13:35:35 +03:00
1.2.4 - Upgraded @flare/tuitio-client.
1.2.5 - Upgraded @flare/tuitio-client.
1.2.6 - Removed specific user groups and roles. Records must be dynamic.