react-manifest-bridge
v2.0.0
Published
A React component for Manifest Bridge
Readme
react-manifest-bridge
React hook and components for integrating with Manifest Bridge
Compatibility
React 16.8+
Install
With npm:
npm install --save react-manifest-bridgeWith yarn:
yarn add react-manifest-bridgeDocumentation
Please refer to the official Manifest Bridge docs
Using React hooks
import { useManifestBridge } from 'react-manifest-bridge';
// ...
// transfer in flow
const { open } = useManinfestBridge({
accessToken: 'YOUR_BRIDGE_TOKEN',
clientId: 'YOUR_CLIENT_ID',
transferIntentReference: 'YOUR_TRANSFER_INTENT_REFERENCE',
environment: 'development',
onSuccess: (transferData) => {
// do something
},
onClose: ({transferIntentStatus, transferData})=>{
// do something
},
onOpen:(status)=>{
if (status === 'success'){
....
}
if (status === 'loading'){
....
}
}
});
return (
<button onClick={open}>
Transfer with Manifest
</button>
);ℹ️ See full source code example at sample code
