New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vesselapi/react-vessel-link

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vesselapi/react-vessel-link

A React component to open the Vessel Connect Modal

  • 1.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
decreased by-44.44%
Maintainers
1
Weekly downloads
 
Created
Source

This package provides:

  1. A React button component that launches the Vessel connect modal.
  2. A Hook that can be used to launch the modal manually.

Installing:

npm:

npm install @vesselapi/react-vessel-link

yarn:

yarn add @vesselapi/react-vessel-link

Usage

The vessel-link modal can be triggered using two methods:

  1. Through the VesselConnectButton component.
  2. Through the useVesselLink hook.

Here are some example uses of each:

function App() {
  return (
    <VesselConnectButton
      getLinkToken={async () => await api.post('link/token')}
      onSuccess={(publicToken) => console.log('public token: ', publicToken)}
      onClose={() => console.log('closed')}
      onLoad={() => console.log('loaded')}
    >
      Connect your CRM!
    </VesselConnectButton>
  );
}
function App() {
  const { open } = useVesselLink({
    onSuccess: (publicToken) => console.log('public token: ', publicToken),
    onClose: () => console.log('closed'),
    onLoad: () => console.log('loaded'),
  });

  return <button onClick={() => open({ linkToken })}>Connect your CRM!</button>;
}

If you'd like to directly open to the auth flow for a specific integration without having the user go through the selection flow, you can pass an integrationId to the open function returned by useVesselLink. Currently, this is only supported when using the useVesselLink hook.

Here's an example of embedding the integrations directly into your application:

function App() {
  const { open } = useVesselLink({
    onSuccess: (publicToken) => console.log('public token: ', publicToken),
    onClose: () => console.log('closed'),
    onLoad: () => console.log('loaded'),
  });

  return (
    <div>
      <button
        onClick={async () =>
          open({
            integrationId: 'salesforce',
            linkToken: await getLinkToken(),
          })
        }
      >
        Connect Salesforce
      </button>
      <button
        onClick={async () =>
          open({
            integrationId: 'hubspot',
            linkToken: await getLinkToken(),
          })
        }
      >
        Connect HubSpot
      </button>
    </div>
  );
}

Issues/Questions

Contact us at support@vessel.land.

FAQs

Package last updated on 17 Mar 2023

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