Socket
Book a DemoInstallSign in
Socket

@trackstar/react-trackstar-link-upgrade

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trackstar/react-trackstar-link-upgrade

A React component to open the Trackstar Connect Modal

latest
Source
npmnpm
Version
1.1.9
Version published
Weekly downloads
1
Maintainers
4
Weekly downloads
 
Created
Source

This package provides:

A React button component that launches the Trackstar connect modal.

Installing:

npm:

npm install @trackstar/react-trackstar-link

yarn:

yarn add @trackstar/react-trackstar-link

Usage

The trackstar-link modal can be triggered using the TrackstarConnectButton component.

import { TrackstarConnectButton } from '@trackstar/react-trackstar-link';

function App() {

  const someCustomerId = "12345";
  return (
    <TrackstarConnectButton
      getLinkToken={async () => {
        const response = await fetch('https://my-company.backend.com/link-token',
          {
            method: 'POST',
          }
        );
        const { linkToken } = await response.json();
        return linkToken;
      }}
      onSuccess={(authCode) => 
        await fetch('https://my-company.backend.com/store-token', {
          method: 'POST',
          body: JSON.stringify({
            customer_id: someCustomerId,
            auth_code: authCode,
          }),
        })
      }
      onClose={() => console.log('closed')}
      onLoad={() => console.log('loaded')}
    >
      Connect your WMS
    </TrackstarConnectButton>
  );
}

Optional Props

Use optional integrationAllowList and integrationBlockList props to determine the specific integrations to display. Both props take an string array of integration names. To only show ShipBob and Ongoing integrations use

integrationAllowList={['shipbob', 'ongoing']}

To show all integrations except ShipBob and Ongoing use

integrationBlockList={['shipbob', 'ongoing']}

The integrationAllowList and integrationBlockList props are mutually exclusive. If both props are given values, all integrations will be displayed. Integration IDs that can be used in these props can be found in the table here: https://docs.trackstarhq.com/introduction#warehouse-management-systems

Set the sandbox prop to true to include a sandbox WMS in the list of integrations. This is useful for testing.

Issues/Questions

Contact us at support@trackstarhq.com.

FAQs

Package last updated on 26 Jul 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