@bindbee/react-link
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

react-link

NPM

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;

Package Sidebar

Install

npm i @bindbee/react-link

Weekly Downloads

95

Version

0.0.6

License

MIT

Unpacked Size

27.8 kB

Total Files

12

Last publish

Collaborators

  • bindbee