Read Plaid identity, items, accounts, balances, and transactions with sandbox-friendly secret-backed helpers.
- Integrations
- plaid
- banking
- accounts
- balances
- transactions
- identity
- sandbox
- finance
- License
- MIT
- Published
- August 22, 2026
- Pinned commit
b7738cb- Rating
- No ratings yet
- Forks
- 0
- Stars
- 0
- Adaptation effort
- —
README
@kody/plaid
Intent
Reusable Plaid helpers so Kody agents can read identity, Items, accounts,
balances, and transactions on the caller's Plaid app — not a shared
platform connection. Auth is a saved client id plus secret. Reads are
free-form and sandbox-first. Link-token creation and other mutations default
to a dry-run preview and need confirm: true to run live.
This listing is meant to be forked. After you fork, save your own
plaidClientId / plaidSecret and call the helpers in your account.
Never ask for or store a bank username or password in chat. Plaid Link (or
the Sandbox public-token helper) is how Items are created.
Share this package as https://kody.codes/@kody/plaid
Auth
Client id + secret (secret-backed). There is no built-in Plaid OAuth
integration and no bank-login flow in this package. Do not open
/connect/oauth for Plaid. Do not collect institution credentials in chat.
| Secret | Purpose |
|---|---|
plaidClientId | Dashboard client id (PLAID_CLIENT_ID) |
plaidSecret | Dashboard secret (PLAID_SECRET) — sandbox or production key |
plaidAccessToken | Optional Item access_token after Link or sandbox exchange |
Create keys at dashboard.plaid.com/developers/keys. Never paste the secret or a bank password into chat.
Required setup
- Create a Plaid account and copy the sandbox
client_idandsecretfrom the Plaid Dashboard keys page. Those dashboard fields are often documented asPLAID_CLIENT_ID/PLAID_SECRETin Plaid's quickstart env files. - Save the client id (do not paste the value in chat):
- Save the secret:
- In the account secrets UI, approve hosts
sandbox.plaid.comandproduction.plaid.comon both secrets. Saving a secret does not approve hosts by itself. - Optional Item access token after Link or a confirmed sandbox exchange (this is not a bank password):
- Run the smoke test below.
Defaults to the Sandbox API (sandbox.plaid.com). Pass
environment: "production" per call to use production.plaid.com. Items
cannot move between environments.
Additional accounts
Pass account: "work" to use plaidClientId-work / plaidSecret-work /
plaidAccessToken-work, or pass clientIdSecret / secretSecret /
accessTokenSecret explicitly.
Hosts
sandbox.plaid.com— default, test Items onlyproduction.plaid.com— live Items (environment: "production")
Bank login policy
Agents must never request, accept, or store a bank username or password.
Plaid Link collects those credentials in Plaid's own UI. This package only
creates a link_token (dry-run by default) or, in Sandbox, a public token
via /sandbox/public_token/create without taking institution credentials.
If Plaid returns ITEM_LOGIN_REQUIRED, create a Link token in update mode
and have the owner complete Link again. Do not ask them to type their bank
password here.
Exports
kody:@kody/plaid— action dispatcher (defaults tosmoke-test); also re-exports every helper belowkody:@kody/plaid/item—getItem,exchangePublicToken,removeItem,updateItemWebhookkody:@kody/plaid/accounts—getAccounts,getBalanceskody:@kody/plaid/identity—getIdentitykody:@kody/plaid/transactions—syncTransactions,listTransactions,refreshTransactionskody:@kody/plaid/institutions—listInstitutions,getInstitution,searchInstitutionskody:@kody/plaid/link—createLinkToken(default dry-run)kody:@kody/plaid/sandbox—createSandboxPublicToken(default dry-run)kody:@kody/plaid/smoke-test— dry-run self-check, then a live institutions read whenplaidClientIdandplaidSecretexist
Low-level transport (plaidRequest, PlaidApiError) stays pinned to
sandbox.plaid.com / production.plaid.com with Plaid-Version: 2020-09-14.
Mutation safety
Link-token creation, sandbox public-token create, public-token exchange,
Item remove, webhook update, and transactions refresh default to dry-run.
They return { dryRun: true, method, path, body } unless you pass
confirm: true. dryRun: true always previews, even with confirm.
import { createLinkToken } from 'kody:@kody/plaid/link'
import { createSandboxPublicToken } from 'kody:@kody/plaid/sandbox'
import { exchangePublicToken } from 'kody:@kody/plaid/item'
const preview = await createLinkToken({
clientName: 'Example Finance',
clientUserId: 'user-123',
})
const sandboxPreview = await createSandboxPublicToken()
const exchanged = await exchangePublicToken({
publicToken: 'public-sandbox-…',
confirm: true,
})After a live exchange, save access_token as plaidAccessToken at the
prefilled secrets URL. Do not leave it in chat longer than needed.
Smoke test
import { packages } from 'kody:runtime'
export default async function main() {
return await packages.invoke({
kodyId: 'plaid',
exportName: './smoke-test',
})
}Without plaidClientId / plaidSecret this still returns
{ ok: true, live: false } plus the setup URLs. With those secrets saved it
lists a few institutions — no Items created, no bank login.
A static import also works after publish:
import plaid from 'kody:@kody/plaid'
export default async function main() {
return await plaid({ action: 'smoke-test' })
}Example
import plaid from 'kody:@kody/plaid'
export default async function main() {
return await plaid({ action: 'get-accounts' })
}Errors
| Plaid response | What to do |
|---|---|
401 / INVALID_API_KEYS | Save plaidClientId and plaidSecret at the URLs above and approve sandbox.plaid.com. |
INVALID_ACCESS_TOKEN | Save plaidAccessToken or pass accessToken from a confirmed exchange. |
ITEM_LOGIN_REQUIRED | Recreate Link in update mode. Never ask for a bank password. |
PRODUCTS_NOT_SUPPORTED | Recreate the Item with that product consented. |
Branding
community-icon.svg is Plaid's official mark from the plaid.com
header (same path as Wikimedia File:Plaid logo.svg), on Plaid black #111111.
Plaid® is a trademark of Plaid Inc. This package is not affiliated with or
endorsed by Plaid.
Docs
Report this listing
Log in to report this listing.