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

@rishavsinghhh/finbridgeai-sdk

v1.0.1

Published

Connect Any Fintech Database to AI — Official FinBridge AI SDK

Downloads

220

Readme

@finbridgeai/sdk

Connect Any Fintech Database to AI

The official Node.js SDK for the FinBridge AI platform — AI-native middleware that securely connects fintech systems, databases, analytics engines, and AI agents through the Model Context Protocol (MCP).

npm version CI License: MIT TypeScript Node.js


Features

  • Full TypeScript support — strict types for every request and response
  • ESM + CommonJS — works in any Node.js project
  • Tree-shakable — import only the modules you use
  • Retry with exponential backoff — automatic recovery from transient failures
  • In-memory cache — reduce redundant API calls
  • Realtime events — WebSocket client with auto-reconnect and heartbeat
  • Middleware pipeline — customise every request/response
  • Rate-limit aware — honours Retry-After headers automatically
  • JWT + API key auth — flexible authentication strategies
  • MCP tool access — discover and invoke AI tools dynamically
  • AI assistant — natural-language queries over your fintech data

Installation

npm install @finbridgeai/sdk
# or
yarn add @finbridgeai/sdk
# or
pnpm add @finbridgeai/sdk

Quick Start

import FinBridgeAI from '@finbridgeai/sdk';

const client = new FinBridgeAI({
  apiKey: 'fb_live_xxxxxxxxxxxx',
  baseUrl: 'https://api.rishavsingh.ai', // optional — this is the default
});

Modules

Payouts

// List failed payouts for a user
const { data: payouts } = await client.payouts.failed({ userId: 101 });

// Create a new payout
const { data: payout } = await client.payouts.create({
  userId: 101,
  amount: 5000,
  currency: 'INR',
  method: 'bank_transfer',
  accountDetails: { accountNumber: '...', ifsc: 'HDFC0001234' },
});

// Retry a failed payout
await client.payouts.retry({ payoutId: payout.id });

Transactions

const { data: txns } = await client.transactions.list({
  userId: 101,
  status: 'failed',
  startDate: '2026-01-01',
  endDate: '2026-05-10',
});

// Reverse a transaction
await client.transactions.reverse(txns[0].id, 'Duplicate charge');

AI Assistant

const { data } = await client.ai.ask({
  prompt: 'Why did payouts fail today?',
  tools: ['get_failed_payouts', 'get_bank_health'],
});

console.log(data.answer);
console.log(data.toolResults); // Results from MCP tools used

// Multi-turn chat
const { data: reply } = await client.ai.chat([
  { role: 'user', content: 'Show me settlement volume for last week' },
]);

// Streaming
for await (const chunk of client.ai.stream({ prompt: 'Explain payout failures' })) {
  process.stdout.write(chunk.delta);
}

Analytics

const { data: summary } = await client.analytics.summary('2026-01-01', '2026-05-10');
console.log(summary.totalVolume, summary.successRate);

const { data: report } = await client.analytics.query({
  startDate: '2026-01-01',
  endDate: '2026-05-10',
  metrics: ['total_transactions', 'payout_success_rate'],
  groupBy: 'day',
});

Settlements

const { data: settlements } = await client.settlements.list({
  merchantId: 'merch_001',
  status: 'pending',
});

// Download CSV report
const { data: { url } } = await client.settlements.exportCsv('2026-01-01', '2026-05-10');

Users

const { data: user } = await client.users.create({
  email: '[email protected]',
  name: 'Alice Singh',
  role: 'merchant',
});

await client.users.suspend(user.id, 'Suspicious activity');

MCP Tools

// List all available tools
const { data: tools } = await client.mcp.listTools();

// Call a specific tool
const { data: result } = await client.mcp.call({
  toolName: 'get_rrn_status',
  arguments: { rrn: '123456789012' },
});

// Batch call
const { data: results } = await client.mcp.batchCall([
  { toolName: 'get_failed_payouts', arguments: { userId: 101 } },
  { toolName: 'get_bank_health', arguments: {} },
]);

Monitoring

const { data: health } = await client.monitoring.health();
console.log(health.status, health.services);

const { data: metrics } = await client.monitoring.metrics();
console.log(`Error rate: ${metrics.errorRate}%`);

Realtime Events

// Subscribe to typed events
client.events.on('payout.failed', (payout) => {
  console.log(`Payout ${payout.id} failed: ${payout.failureReason}`);
});

client.events.on('transaction.completed', (txn) => {
  console.log(`Transaction ${txn.id} completed — ₹${txn.amount}`);
});

client.events.on('system.alert', (alert) => {
  console.warn(`[${alert.level}] ${alert.message}`);
});

// Connect the WebSocket
client.realtime.connect();

// Subscribe to a specific channel
client.realtime.subscribe('payouts:failed');

// Disconnect gracefully
client.realtime.disconnect();

Authentication

// Login with credentials — SDK auto-attaches the returned JWT
const { data: tokens } = await client.auth.login({
  email: '[email protected]',
  password: 'super_secret',
});

// Refresh
await client.auth.refresh({ refreshToken: tokens.refreshToken! });

// API key management
const { data: keys } = await client.auth.listApiKeys();
await client.auth.rotateApiKey(keys[0].keyId);

Advanced Configuration

const client = new FinBridgeAI({
  apiKey: 'fb_live_xxxx',
  baseUrl: 'https://api.rishavsingh.ai',
  timeout: 20_000,        // 20 s request timeout
  retries: 3,             // retry up to 3 times
  retryDelay: 500,        // base delay (exponential backoff)
  debug: true,            // verbose logging
  cache: {
    enabled: true,
    ttl: 30_000,          // 30 s TTL
    maxSize: 200,         // up to 200 cached entries
  },
  logger: {
    enabled: true,
    level: 'info',
    handler: (level, message, meta) => myLogger[level](message, meta),
  },
  defaultHeaders: {
    'X-App-Version': '2.0.0',
  },
});

Custom Middleware

// Add a request middleware
client._http.middleware.useRequest(async (config) => {
  config.headers['X-Correlation-Id'] = crypto.randomUUID();
  return config;
});

// Add a response middleware
client._http.middleware.useResponse(async (response) => {
  myMetrics.increment('api.calls');
  return response;
});

Error Handling

import {
  FinBridgeAI,
  AuthenticationError,
  RateLimitError,
  ValidationError,
  NotFoundError,
} from '@finbridgeai/sdk';

try {
  await client.payouts.create({ /* ... */ });
} catch (err) {
  if (err instanceof ValidationError) {
    console.error('Validation failed:', err.fields);
  } else if (err instanceof RateLimitError) {
    console.error(`Rate limited — retry after ${err.retryAfter}s`);
  } else if (err instanceof AuthenticationError) {
    console.error('Invalid or expired credentials');
  } else if (err instanceof NotFoundError) {
    console.error('Resource not found');
  } else {
    throw err; // unexpected
  }
}

Tree-Shaking

Import individual modules to keep your bundle lean:

import { PayoutsModule } from '@finbridgeai/sdk/payouts';
import { AnalyticsModule } from '@finbridgeai/sdk/analytics';

Publishing to npm

# Authenticate
npm login

# Build and publish
npm publish --access public

# Or with a specific tag
npm publish --tag beta --access public

Semantic versioning is handled automatically via semantic-release when commits follow Conventional Commits.


Development

# Install dependencies
npm install

# Build (ESM + CJS + types)
npm run build

# Type-check without emitting
npm run typecheck

# Watch mode
npm run dev

# Run tests
npm test

# Lint
npm run lint

# Format
npm run format

Author

Rishav Singh Senior Software Engineer


License

MIT © Rishav Singh