tuitio-client-react/README.md

44 lines
1.9 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!
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");
```
```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";
```
## 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 - 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
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.