@citadelid/react
v2.0.2
Published
Citadel Bridge initialization package for react
Downloads
2
Readme
Citadelid React Bridge
React library for integrating with the Citadelid Bridge
Install
With npm
:
npm install @citadelid/react --save
With yarn
yarn add -S @citadelid/react
Usage
import ReactDOM from 'react-dom';
import React, { useState } from 'react';
import CitadelBridge from '@citadelid/react';
const BridgeElement = () => {
const [isOpened, setOpened] = useState(false);
return (
<>
<button onClick={() => setOpened(true)}>Open</button>
<CitadelBridge
bridgeToken="<previously generated bridge token>" // more info https://docs.citadelid.com/#bridge-token
onClose={() => setOpened(false)}
onSuccess={(publicToken, metaData) => {
setOpened(false);
console.log(publicToken, metaData);
}}
isOpened={isOpened}
/>
</>
);
}