@bindbee/react-link
v0.0.6
Published
React hook wrapper for Bindbee's connector link flow
Downloads
369
Readme
react-link
The React SDK for embedding Bindbee's Connector Link Flow
See the detailed documentation on Bindbee SDK Documentation
Install
npm install --save @bindbee/react-link
or
yarn add @bindbee/react-link
Usage
import React from "react";
// Run this in your React project:
// npm install --save @bindbee/react-link
import { useBindbeeMagiclink } from "@bindbee/react-link";
const App = () => {
const handleOnSuccess = (temporary_token) => {
// Use this token to get the connector_token
console.log("Temporary Token:", temporary_token);
};
const handleOnClose = () => {
// Optional: Perform any action when the user closes the linking flow
console.log("Linking flow closed");
};
const { open } = useBindbeeMagiclink({
linkToken: "LINK_TOKEN", // Replace LINK_TOKEN with the token retrieved from previous step,
serverUrl: "https://api.bindbee.dev", // (OPTIONAL): use 'https://api-eu.bindbee.dev' for EU Region
onSuccess: handleOnSuccess,
onClose: handleOnClose,
});
return <button onClick={open}>Open Linking Flow</button>;
};
export default App;