Registry / finance / plaid-fetch

plaid-fetch

JSON →
library1.0.2jsnpmunverified

Community-maintained Plaid API client using fetch instead of Axios, generated from Plaid's OpenAPI spec via @openapitools/openapi-generator-cli (typescript-fetch). Current version 1.0.2. Built for edge environments (Cloudflare Workers, Deno, browser-like runtimes) where Plaid's official Node SDK (Axios-dependent) does not work. Key difference: responses returned directly without .data wrapper. Actively maintained on GitHub with plans for automated releases.

npm install plaid-fetch
INSTALL
IMPORT
SIG · PLAID-FETCH
P
plaid-fetch
financejavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Configuration
import { Configuration } from 'plaid-fetch'
import Configuration from 'plaid-fetch'
Named export, not default.
PlaidApi
import { PlaidApi } from 'plaid-fetch'
const PlaidApi = require('plaid-fetch').PlaidApi
ESM only; CommonJS require is possible but not recommended.
Configuration
import { Configuration, PlaidApi } from 'plaid-fetch'
import { Configuration as Config, PlaidApi } from 'plaid-fetch'
Alias is fine but not needed. Both must be imported together.

Initializes Plaid client with sandbox keys, makes a transactionsEnrich request, and logs the enriched transactions.

import { Configuration, PlaidApi } from 'plaid-fetch'; const config = new Configuration({ basePath: 'https://sandbox.plaid.com', headers: { 'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID ?? '', 'PLAID-SECRET': process.env.PLAID_SECRET ?? '', }, }); const plaid = new PlaidApi(config); async function main() { const response = await plaid.transactionsEnrich({ account_type: 'credit', transactions: [{ id: 'abc123', description: 'SQ *COACHELLA VALLEY M Royal Oak MI US 48067', amount: 26.10, direction: 'OUTFLOW', mcc: '5814', date_posted: new Date('2024-04-14'), iso_currency_code: 'USD', location: { country: 'US', region: 'MI', city: 'Royal Oak', postal_code: '48067' } }] }); console.log(response.enriched_transactions); } main().catch(console.error);
Debug
Known issues
gotchaResponses are returned directly without .data wrapper (unlike official SDK). May change in future major version.
fix
Access response properties directly (e.g., response.enriched_transactions) instead of response.data.enriched_transactions.
affects: >=1.0.0
deprecatedNo automated releases yet; updates may lag behind Plaid API changes.
fix
Manually regenerate using 'pnpm generate' or wait for maintainer to publish new version.
affects: >=1.0.0
gotchaConfiguration requires basePath and headers (PLAID-CLIENT-ID, PLAID-SECRET) passed manually; no environment detection.
fix
Set basePath to 'https://sandbox.plaid.com', 'https://development.plaid.com', or 'https://production.plaid.com' as appropriate. Include client ID and secret in headers.
affects: >=1.0.0
gotchaBuilt with typescript-fetch generator; some endpoints may have different parameter shapes than official SDK.
fix
Check the generated types/docs on GitHub for exact parameter structures.
affects: >=1.0.0
breakingThis is not the official Plaid SDK; no official support. Use at your own risk.
fix
Consider using official @plaid/plaid-sdk for Node.js environments with Axios support.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'enriched_transactions' of 'response' as it is undefined.
Response structure mismatch; official SDK wraps in 'data' object but this library returns directly.
fix
Access response.enriched_transactions directly, not response.data.enriched_transactions.
Error: 400 Bad Request - PLAID_CLIENT_ID is required.
Missing client ID in headers.
fix
Ensure 'PLAID-CLIENT-ID' header is set in Configuration headers.
TypeScript error: Module '"plaid-fetch"' has no exported member 'PlaidApi'.
Wrong import syntax (default import instead of named).
fix
Use import { PlaidApi } from 'plaid-fetch' (curly braces).
ReferenceError: fetch is not defined.
Environment does not have native fetch (e.g., older Node.js <18).
fix
Use Node.js 18+ or polyfill fetch (e.g., node-fetch).
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
fetchrequiredUses native fetch API (no external HTTP client dependency)
Agent activity
37 hits · last 30 days
node
34
Resources
plaid-fetch — npm install plaid-fetch · libregistry