> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Plaid with OAuth 2.0 — Production – StackOne Hub

> Link a Plaid account in the StackOne Hub using OAuth 2.0 — Production. End-user guide to authorize the integration and start using Plaid actions.

<Warning>Plaid does not allow servers to mint a Production `public_token` from a username and password. Your end user must complete Plaid Link in a browser — you cannot automate this. Once they do, capture the `public_token` Plaid Link returns and paste it below. StackOne handles the exchange for the permanent `access_token` automatically.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>1. Mint a link\_token from your backend</h2>

  <p>Before opening Plaid Link, your backend must create a short-lived `link_token` that configures the Link session for this specific user.</p>

  <Steps>
    <Step title="Call /link/token/create">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>From your backend (server-side, never client-side), call `POST https://production.plaid.com/link/token/create` with at minimum:</p>

        <ul>
          <li>**`client_id`<strong> and </strong>`secret`** — your Plaid credentials</li>
          <li>**`user.client_user_id`** — a stable unique ID for this end user in your system (UUID recommended)</li>
          <li>**`client_name`** — your app's display name shown to the user during Link</li>
          <li>**`products`** — array of products to enable (e.g., `["transactions", "auth"]`)</li>
          <li>**`country_codes`** — e.g., `["US"]`</li>
          <li>**`language`** — e.g., `"en"`</li>
          <li>**`redirect_uri`** — the URI you registered in Setup step 4 (only required if you support OAuth banks)</li>
        </ul>
      </div>
    </Step>

    <Step title="Capture the link_token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Plaid responds with `{ link_token: "link-production-...", expiration }`. The `link_token` is valid for 4 hours. You will pass it to Plaid Link in the next step.</p>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>2. Open Plaid Link in a browser</h2>

  <p>Plaid Link is the hosted UI Plaid serves. The user picks their bank, types their banking credentials, and completes any MFA — Plaid never exposes the bank password to you. Two minimal ways to run it:</p>

  <Steps>
    <Step title="Option A — Plaid Quickstart (fastest)">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Clone <a href="https://github.com/plaid/quickstart" target="_blank" rel="noopener noreferrer">Plaid Quickstart</a> and follow the README. It runs locally with Docker or Node.js, opens Plaid Link in your browser, the user authenticates with their real bank, and the Quickstart app prints the resulting `public_token` to its console. Copy it.</p>
      </div>
    </Step>

    <Step title="Option B — Embed Plaid Link in your own app">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Load the Plaid Link Web SDK and initialize it with the `link_token` from step 1.</p>

        <ul>
          <li>Add `<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>` to your page.</li>
          <li>Call `Plaid.create({ token: 'YOUR_LINK_TOKEN', onSuccess: (public_token, metadata) => console.log(public_token) }).open()`.</li>
          <li>After the user finishes authenticating, the `public_token` arrives in the `onSuccess` callback. Capture it (e.g., POST it to your backend, or for testing log it to the browser console).</li>
          <li>Full reference: [https://plaid.com/docs/link/web/](https://plaid.com/docs/link/web/)</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>3. Paste the public\_token below</h2>

  <p>Take the `public_token` from step 2 and paste it into the <strong>Public Token</strong> field in StackOne, then click <strong>Connect</strong>.</p>

  <Steps>
    <Step title="public_tokens are short-lived">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>A `public_token` is single-use and expires roughly 30 minutes after Plaid Link issues it. If you wait too long the exchange will fail and you will need to re-run Plaid Link to get a new one.</p>
      </div>
    </Step>

    <Step title="What StackOne does next">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>When you click Connect, StackOne calls `POST /item/public_token/exchange` with your `client_id`, `secret`, and the `public_token`. Plaid returns a permanent `access_token` (Plaid `access_tokens` do not expire) which StackOne stores on this connection. All actions for the products you specified in `/link/token/create` are now ready to run.</p>
      </div>
    </Step>

    <Step title="One Item per connection">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Each `access_token` is tied to one Item — one user's connection to one financial institution. To connect a different user or a different bank for the same user, create a new connection and run Plaid Link again.</p>
      </div>
    </Step>
  </Steps>
</section>

<div data-whitelabel-hide>
  <h2>Linking the Account from the Hub</h2>

  <Steps>
    <Step title="Navigate to the Hub">
      Use one of the three <a href="/guides/accounts-section#linking-accounts">Linking Account Methods</a> to access the Hub.
    </Step>

    <Step title="Fill out the fields">
      Fill out the following fields using details from your provider:

      <ul>
        <li><strong>Public Token</strong></li>
      </ul>
    </Step>

    <Step title="Connect">
      <ul>
        <li>Click <strong>Connect</strong></li>
        <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
        <li>Once authorization is successful, you will see a confirmation popup</li>
      </ul>
    </Step>
  </Steps>

  <p>If the account linking is successful, you will see the newly linked account in your <a href="/guides/accounts-section">Accounts</a> page.</p>
</div>
