npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dschz/solid-plaid-link

v0.1.5

Published

SolidJS wrapper for Plaid Link to seamlessly integrate Plaid into Solid apps.

Readme

@dschz/solid-plaid-link

License npm Bundle Size JSR CI Discord

SolidJS library for integrating with Plaid Link. Dynamically loads the Link script, manages token expiration, supports OAuth redirects, and caches tokens safely across reloads.

✨ Features

  • 🧠 createPlaidLink hook for full control over the Link lifecycle
  • 📊 <PlaidEmbeddedLink /> component for iframe-based embedded UI
  • 🔁 Built-in caching to persist tokens across reloads (OAuth-safe)
  • 💡 Works seamlessly with custom UI libraries like Kobalte, Ark, Solid UI, or Tailwind

📆 Installation

npm install @dschz/solid-plaid-link
pnpm install @dschz/solid-plaid-link
yarn install @dschz/solid-plaid-link
bun install @dschz/solid-plaid-link

🔌 Core: createPlaidLink

Use createPlaidLink when you want full control over when and how to open Plaid Link imperatively.

import { createPlaidLink } from "@dschz/solid-plaid-link";

const { ready, error, plaidLink } = createPlaidLink(() => ({
  fetchToken: () => fetch("/api/create-link-token").then((res) => res.json()),
  onSuccess: (publicToken, meta) => console.log(publicToken),
}));

return (
  <button disabled={!ready()} onClick={() => plaidLink().open()}>
    Connect Bank Account
  </button>
);

💡 You can pair createPlaidLink with any UI library of your choice (e.g., Kobalte, Ark UI, Solid UI, Tailwind, etc.) to build a fully custom button that triggers Plaid Link.

🖼️ PlaidEmbeddedLink

Use this JSX component when you want to embed the Link experience directly into the page via Plaid.createEmbedded.

import { PlaidEmbeddedLink } from "@dschz/solid-plaid-link";

<PlaidEmbeddedLink
  fetchToken={() => fetch("/api/create-link-token").then((r) => r.json())}
  onSuccess={(token, meta) => console.log(token)}
  onError={(err) => console.error(err)}
/>;

🔒 OAuth-safe: receivedRedirectUri can be passed to resume the session after redirect.

🔁 Token Caching (for OAuth + reload resilience)

Plaid link tokens are automatically cached (in sessionStorage by default) when you use createPlaidLink or PlaidEmbeddedLink. This is useful for:

  • Surviving OAuth redirects
  • Avoiding repeated calls to your backend

Caching is enabled by default. You can customize or disable it:

createPlaidLink(() => ({
  fetchToken: () => fetch("/api/create-link-token").then((r) => r.json()),
  cache: true, // default
  cacheOptions: {
    storage: localStorage, // or sessionStorage (default)
    storageKey: "my_plaid_token",
    bufferMs: 30000, // time before expiration to refresh
  },
  onSuccess: console.log,
}));

🔀 OAuth Redirects

To support institutions that require OAuth, pass receivedRedirectUri into the hook or component after the redirect.

const isOAuth = window.location.search.includes("oauth_state_id");

createPlaidLink(() => ({
  fetchToken: () => fetch("/api/create-link-token").then((r) => r.json()),
  receivedRedirectUri: isOAuth ? window.location.href : undefined,
  onSuccess: console.log,
}));

🧪 Testing

  • ESM-native and works with vitest, bun, or jest + JSDOM
  • You can mock window.Plaid, localStorage, or sessionStorage easily

💪 Types

type CreatePlaidLinkConfig = {
  fetchToken: () => Promise<{ link_token: string; expiration: string }>;
  onSuccess: (publicToken: string, metadata: PlaidLinkOnSuccessMetadata) => void;
  onExit?: (...);
  onEvent?: (...);
  onLoad?: () => void;
  receivedRedirectUri?: string;
  cache?: boolean;
  cacheOptions?: {
    storage?: Storage;
    storageKey?: string;
    bufferMs?: number;
  };
};

Additional types like PlaidLinkError, PlaidLinkOnExitMetadata, and PlaidLinkOnEventMetadata are exported for convenience.

🧪 Playground Sandbox

This repo includes a full working example app to test Plaid Link with your API keys.

Running the Playground

  1. Clone the repo:

    git clone https://github.com/dsnchz/solid-plaid-link.git
    cd solid-plaid-link
  2. Install deps:

    npm install
    pnpm install
    yarn install
    bun install
  3. Add .env with your Plaid keys:

    PLAID_CLIENT_ID=your_client_id
    PLAID_SECRET=your_secret_key
  4. Run frontend + backend:

    bun run start          # frontend
    bun run start:server   # backend
  5. Visit http://localhost:3000

The Bun backend handles link token creation and must be running.

🙋‍♂️ Feedback

Found an issue or have a question? Open a discussion or PR at github.com/dsnchz/solid-plaid-link.