Initialization

How to create a Deck instance

Here's the code to instantiate the Link widget by providing a few parameters:

const deck = Deck.create({
  token: "link-sandbox-00000000-0000-0000-0000-000000000000",
  onSuccess: ({ public_token }) => {},
  onExit: () => {},
  source_id: "00000000-0000-0000-0000-000000000000",
})

Parameters

token - Required

You must provide a token to authenticate a new Link session. This is a short lived, one-time use token that is unique to each Link session. Obtaine your token by calling the /link/token/create endpoint from your backend to not expose your client id and secret keys.

onSuccess

A function that is called when a user successfully creates a connection. You should implement it for sending the public_token returned by the Link iframe to your backend.

onExit

A function that is called when a user exits Link.

source_id

If provided, the Link user will immediately be prompted to enter credentials for the corresponding source.