Link Installation

The SDK is a script for our customers to integrate the Link iframe easily.

This page explains how to import the SDK into your application.

For detailed usage, review the following pages:

Web

Start by adding the Deck link-initialize script on each page of your site.

<script src="https://link.deck.co/link-initialize.js"></script>

It must always be loaded directly from <https://link.deck.co> rather than included in a bundle or hosted yourself.

The JavaScript web SDK is not versioned and the latest available SDK will always be returned.

This will expose a global Deck object, which can be instantiated using the following code:

const deck = Deck.create(parameters)

React

Start by installing the react-deck-link NPM package:

yarn add react-deck-link

This will expose a useDeckLink hook which can be used to instantiate Link in your React application:

import { useDeckLink } from 'react-deck-link';

const OpenLink = () => {
  const deck = useDeckLink(parameters);
  return <button onClick={deck.open}>Connect</button>;
}