{"id":31940328,"url":"https://github.com/dsnchz/solid-plaid-link","last_synced_at":"2025-10-14T08:53:28.699Z","repository":{"id":293704276,"uuid":"983185328","full_name":"dsnchz/solid-plaid-link","owner":"dsnchz","description":"SolidJS wrapper for Plaid Link – seamlessly integrate Plaid into Solid apps.","archived":false,"fork":false,"pushed_at":"2025-06-05T16:58:29.000Z","size":117,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T19:41:47.297Z","etag":null,"topics":["banking-api","finance","fintech","solidjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsnchz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-14T02:32:43.000Z","updated_at":"2025-06-11T13:37:14.000Z","dependencies_parsed_at":"2025-05-16T18:25:45.752Z","dependency_job_id":null,"html_url":"https://github.com/dsnchz/solid-plaid-link","commit_stats":null,"previous_names":["dsnchz/solid-plaid-link"],"tags_count":4,"template":false,"template_full_name":"thedanchez/template-solidjs-library","purl":"pkg:github/dsnchz/solid-plaid-link","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-plaid-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-plaid-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-plaid-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-plaid-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsnchz","download_url":"https://codeload.github.com/dsnchz/solid-plaid-link/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsnchz%2Fsolid-plaid-link/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018015,"owners_count":26086237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banking-api","finance","fintech","solidjs"],"created_at":"2025-10-14T08:52:55.845Z","updated_at":"2025-10-14T08:53:28.690Z","avatar_url":"https://github.com/dsnchz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg width=\"100%\" src=\"https://assets.solidjs.com/banner?type=Ecosystem\u0026background=tiles\u0026project=solid-plaid-link\" alt=\"solid-plaid-link\"\u003e\n\u003c/p\u003e\n\n# @dschz/solid-plaid-link\n\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n[![npm](https://img.shields.io/npm/v/@dschz/solid-plaid-link?color=blue)](https://www.npmjs.com/package/@dschz/solid-plaid-link)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@dschz/solid-uplot)](https://bundlephobia.com/package/@dschz/solid-plaid-link)\n[![JSR](https://jsr.io/badges/@dschz/solid-plaid-link/score)](https://jsr.io/@dschz/solid-plaid-link)\n[![CI](https://github.com/dsnchz/solid-plaid-link/actions/workflows/ci.yaml/badge.svg)](https://github.com/dsnchz/solid-plaid-link/actions/workflows/ci.yaml)\n[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord\u0026logoColor=white)](https://discord.gg/McSuU38GHg)\n\nSolidJS library for integrating with [Plaid Link](https://plaid.com/docs/link/). Dynamically loads the Link script, manages token expiration, supports OAuth redirects, and caches tokens safely across reloads.\n\n## ✨ Features\n\n- 🧠 `createPlaidLink` hook for full control over the Link lifecycle\n- 📊 `\u003cPlaidEmbeddedLink /\u003e` component for iframe-based embedded UI\n- 🔁 Built-in caching to persist tokens across reloads (OAuth-safe)\n- 💡 Works seamlessly with custom UI libraries like Kobalte, Ark, Solid UI, or Tailwind\n\n## 📆 Installation\n\n```bash\nnpm install @dschz/solid-plaid-link\npnpm install @dschz/solid-plaid-link\nyarn install @dschz/solid-plaid-link\nbun install @dschz/solid-plaid-link\n```\n\n## 🔌 Core: `createPlaidLink`\n\nUse `createPlaidLink` when you want full control over when and how to open Plaid Link imperatively.\n\n```tsx\nimport { createPlaidLink } from \"@dschz/solid-plaid-link\";\n\nconst { ready, error, plaidLink } = createPlaidLink(() =\u003e ({\n  fetchToken: () =\u003e fetch(\"/api/create-link-token\").then((res) =\u003e res.json()),\n  onSuccess: (publicToken, meta) =\u003e console.log(publicToken),\n}));\n\nreturn (\n  \u003cbutton disabled={!ready()} onClick={() =\u003e plaidLink().open()}\u003e\n    Connect Bank Account\n  \u003c/button\u003e\n);\n```\n\n\u003e 💡 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.\n\n## 🖼️ `PlaidEmbeddedLink`\n\nUse this JSX component when you want to embed the Link experience directly into the page via `Plaid.createEmbedded`.\n\n```tsx\nimport { PlaidEmbeddedLink } from \"@dschz/solid-plaid-link\";\n\n\u003cPlaidEmbeddedLink\n  fetchToken={() =\u003e fetch(\"/api/create-link-token\").then((r) =\u003e r.json())}\n  onSuccess={(token, meta) =\u003e console.log(token)}\n  onError={(err) =\u003e console.error(err)}\n/\u003e;\n```\n\n\u003e 🔒 OAuth-safe: `receivedRedirectUri` can be passed to resume the session after redirect.\n\n## 🔁 Token Caching (for OAuth + reload resilience)\n\nPlaid link tokens are automatically cached (in `sessionStorage` by default) when you use `createPlaidLink` or `PlaidEmbeddedLink`. This is useful for:\n\n- Surviving OAuth redirects\n- Avoiding repeated calls to your backend\n\nCaching is enabled by default. You can customize or disable it:\n\n```tsx\ncreatePlaidLink(() =\u003e ({\n  fetchToken: () =\u003e fetch(\"/api/create-link-token\").then((r) =\u003e r.json()),\n  cache: true, // default\n  cacheOptions: {\n    storage: localStorage, // or sessionStorage (default)\n    storageKey: \"my_plaid_token\",\n    bufferMs: 30000, // time before expiration to refresh\n  },\n  onSuccess: console.log,\n}));\n```\n\n## 🔀 OAuth Redirects\n\nTo support institutions that require OAuth, pass `receivedRedirectUri` into the hook or component after the redirect.\n\n```tsx\nconst isOAuth = window.location.search.includes(\"oauth_state_id\");\n\ncreatePlaidLink(() =\u003e ({\n  fetchToken: () =\u003e fetch(\"/api/create-link-token\").then((r) =\u003e r.json()),\n  receivedRedirectUri: isOAuth ? window.location.href : undefined,\n  onSuccess: console.log,\n}));\n```\n\n## 🧪 Testing\n\n- ESM-native and works with `vitest`, `bun`, or `jest` + JSDOM\n- You can mock `window.Plaid`, `localStorage`, or `sessionStorage` easily\n\n## 💪 Types\n\n```ts\ntype CreatePlaidLinkConfig = {\n  fetchToken: () =\u003e Promise\u003c{ link_token: string; expiration: string }\u003e;\n  onSuccess: (publicToken: string, metadata: PlaidLinkOnSuccessMetadata) =\u003e void;\n  onExit?: (...);\n  onEvent?: (...);\n  onLoad?: () =\u003e void;\n  receivedRedirectUri?: string;\n  cache?: boolean;\n  cacheOptions?: {\n    storage?: Storage;\n    storageKey?: string;\n    bufferMs?: number;\n  };\n};\n```\n\nAdditional types like `PlaidLinkError`, `PlaidLinkOnExitMetadata`, and `PlaidLinkOnEventMetadata` are exported for convenience.\n\n## 🧪 Playground Sandbox\n\nThis repo includes a full working example app to test Plaid Link with your API keys.\n\n### Running the Playground\n\n1. Clone the repo:\n\n   ```bash\n   git clone https://github.com/dsnchz/solid-plaid-link.git\n   cd solid-plaid-link\n   ```\n\n2. Install deps:\n\n   ```bash\n   npm install\n   pnpm install\n   yarn install\n   bun install\n   ```\n\n3. Add `.env` with your Plaid keys:\n\n   ```\n   PLAID_CLIENT_ID=your_client_id\n   PLAID_SECRET=your_secret_key\n   ```\n\n4. Run frontend + backend:\n\n   ```bash\n   bun run start          # frontend\n   bun run start:server   # backend\n   ```\n\n5. Visit [http://localhost:3000](http://localhost:3000)\n\n\u003e The Bun backend handles link token creation and must be running.\n\n## 🙋‍♂️ Feedback\n\nFound an issue or have a question?\nOpen a discussion or PR at [github.com/dsnchz/solid-plaid-link](https://github.com/dsnchz/solid-plaid-link).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnchz%2Fsolid-plaid-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsnchz%2Fsolid-plaid-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsnchz%2Fsolid-plaid-link/lists"}