authID integration as a React.js Component
npm install @authid/react-componentThis authID React.js Component provides a convenient integration overlay. The overlay hovers over your website in desktop environment and occupies maximum space in mobile environment.
This integration uses @authid/web-component package.
The plugin is not preprocessed with Babel intentionally. Please make sure your Webpack or other build tool configuration handles translation of node_modules/@authid/*.js modules.
React.js with hooks is a peer dependency.
* AuthIDComponent - a React.js component with the following properties:
- url - required parameter with operation/transaction URL received from authID,
- target - force selection of either mobile or desktop integration variant, auto is the default,
- webauth=true - enable automatic handling of WebAuth features,
- control=(msg, authidControlFace) => {} - enable advanced control features with a special callback,
- onError=(event) => {} - underlying web component "error" event handler.
Please see example.jsx and example.html for full details.
Note: you will need to install development dependencies and build example.min.js first.
``jsx
import AuthIDComponent from '@authid/react-component';
const control = (msg, controlFace) => {
// ...
};
const onError = (event) => {
// ...
};
const App = () => {
return
};
``