Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-plaid-link

Package Overview
Dependencies
Maintainers
7
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-plaid-link

A React component for Plaid Link

  • 3.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created

What is react-plaid-link?

The react-plaid-link npm package is a React wrapper for Plaid Link, which is a quick and secure way to integrate with the Plaid API. It allows users to connect their bank accounts to your application, enabling functionalities like retrieving account balances, transaction histories, and more.

What are react-plaid-link's main functionalities?

Initialize Plaid Link

This code demonstrates how to initialize Plaid Link in a React application. The `PlaidLink` component is configured with necessary props like `clientName`, `env`, `product`, `publicKey`, and `onSuccess` callback.

import React from 'react';
import { PlaidLink } from 'react-plaid-link';

const App = () => {
  const onSuccess = (public_token, metadata) => {
    console.log('Public Token: ', public_token);
    console.log('Metadata: ', metadata);
  };

  return (
    <PlaidLink
      clientName="Your App Name"
      env="sandbox"
      product={['auth', 'transactions']}
      publicKey="your_public_key"
      onSuccess={onSuccess}
    >
      Connect a bank account
    </PlaidLink>
  );
};

export default App;

Handle onExit Callback

This code demonstrates how to handle the `onExit` callback, which is triggered when the user exits the Plaid Link flow. The `onExit` callback provides error information and metadata.

import React from 'react';
import { PlaidLink } from 'react-plaid-link';

const App = () => {
  const onExit = (error, metadata) => {
    console.log('Error: ', error);
    console.log('Metadata: ', metadata);
  };

  return (
    <PlaidLink
      clientName="Your App Name"
      env="sandbox"
      product={['auth', 'transactions']}
      publicKey="your_public_key"
      onExit={onExit}
    >
      Connect a bank account
    </PlaidLink>
  );
};

export default App;

Handle onEvent Callback

This code demonstrates how to handle the `onEvent` callback, which is triggered for various events during the Plaid Link flow. The `onEvent` callback provides the event name and metadata.

import React from 'react';
import { PlaidLink } from 'react-plaid-link';

const App = () => {
  const onEvent = (eventName, metadata) => {
    console.log('Event Name: ', eventName);
    console.log('Metadata: ', metadata);
  };

  return (
    <PlaidLink
      clientName="Your App Name"
      env="sandbox"
      product={['auth', 'transactions']}
      publicKey="your_public_key"
      onEvent={onEvent}
    >
      Connect a bank account
    </PlaidLink>
  );
};

export default App;

Other packages similar to react-plaid-link

Keywords

FAQs

Package last updated on 30 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc