See examples of code for integration through our Quickstart.
Deck officially supports the Widget on the latest versions of Chrome, Firefox, Safari, and Edge. Supported platforms include Windows, Mac, Linux, iOS, and Android.
Older versions of browsers are supported only if they are still receiving security and maintenance updates.
Unsupported browsers include those officially marked as End of Life (EOL) or End of Support (EOS).
For a list of available parameters and functions, see SDK parameters.

Web

Add the Deck SDK by including the link-initialize script on each page of your site:
<script src="https://link.deck.co/link-initialize.js"></script>
This script must always be loaded directly from link.deck.co - deck.co
Do not self-host or bundle it.
The script exposes a global Deck object. To initialize the Widget:
const deck = Deck.create(parameters);

React

Install the react-deck-link - npmjs.com package:
yarn add react-deck-link
You can use the useDeckLink hook like this:
import { useDeckLink } from 'react-deck-link';

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

Parameters

Example of how to instantiate the Widget with parameters:
const parameters = {
  token: "link-sandbox-00000000-0000-0000-0000-000000000000",
  onSuccess: ({ job_guid }) => {},
  onExit: () => {}
};

token (Required)

The Link token authorizes a new Widget session. It is short-lived and one-time use.
Call the /link/token/create endpoint from your backend to avoid exposing your Client ID and secret.

onSuccess

Function called when a connection is successfully created. Use it to pass the Job Guid to your backend.

onError

Function triggered if the Widget encounters an error while submitting credentials.

onExit

Function triggered when a user closes or exits the Widget.

source_id (Optional)

If provided, the Widget opens with the selected source preloaded.

Functions

open()

Displays the Consent Pane and starts the Widget flow.
deck.open();

exit()

Closes the Widget programmatically and triggers the onExit callback.
deck.exit();