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

lumeo-sdk

v0.1.0

Published

Official TypeScript SDK for Lumeo programmable financial infrastructure APIs.

Readme

@lumeo/sdk

Official TypeScript SDK for Lumeo, a programmable financial infrastructure platform for India's developer ecosystem.

Lumeo's Vault API helps freelancers, agencies, and B2B exporters programmatically manage inbound payments, contract-engine rules, settlement sweeps, beneficiaries, and compliance workflows.

Complete documentation set

  • README.md (this file): quickstart + core usage
  • docs/END_TO_END.md: full integration walkthrough from setup to production
  • docs/API_REFERENCE.md: method-level API surface and behavior
  • docs/RELEASE.md: build, test, package, and publish runbook

Package artifact metadata (from npm pack --dry-run)

| Field | Value | |---|---| | Package | @lumeo/[email protected] | | Unpacked size | 328.5 kB | | Shasum | 6fc5a72d86a4e8c47275fa697bd36beaf5056291 | | Integrity | sha512-oqWmQugxIdUqk[...]Bpcymsbp/XtLQ== | | Total files | 8 |

Installation

npm install @lumeo/sdk

Quickstart

import LumeoClient, { RuleDSL } from '@lumeo/sdk';

const client = new LumeoClient({
	apiKey: process.env.LUMEO_API_KEY!,
	baseUrl: 'https://api.lumeo.in/v1',
	timeout: 30_000,
	retries: 3,
	idempotencyPrefix: 'myapp',
});

// 1) Create vault
const vault = await client.vaults.create({
	ownerId: 'org_123',
	label: 'Export Receivables - USD',
	currency: 'USD',
	metadata: { segment: 'b2b-export' },
});

// 2) Create rule (split + notify)
const dsl: RuleDSL = {
	version: '1.0',
	trigger: {
		event: 'inbound_payment',
		conditions: [{ field: 'amountRaw', operator: 'gt', value: 5_000_000 }],
	},
	actions: [
		{
			type: 'split',
			splits: [
				{ beneficiaryId: 'bene_ops', percentage: 70 },
				{ beneficiaryId: 'bene_gst', percentage: 30 },
			],
		},
		{
			type: 'notify',
			channel: 'webhook',
			payload: { topic: 'payment.large' },
		},
	],
};

const rule = await client.rules.create({
	ownerId: 'org_123',
	name: 'Large Invoice Split Rule',
	dsl,
});

// 3) Attach rule to vault
await client.vaults.attachRule(vault.id, rule.id);

// 4) Query received payments (transactions)
const txPage = await client.transactions.list({ vaultId: vault.id, limit: 10 });
console.log('Recent tx count:', txPage.data.length);

Client configuration

type LumeoClientConfig = {
	apiKey: string;
	baseUrl?: string;
	timeout?: number;          // default: 30000 ms
	retries?: number;          // default: 3
	idempotencyPrefix?: string;
	defaultHeaders?: HeadersInit;
	onRequest?: (ctx) => void | Promise<void>;
	onResponse?: (ctx) => void | Promise<void>;
	onError?: (ctx) => void | Promise<void>;
};

Advanced client hooks (observability)

const client = new LumeoClient({
	apiKey: process.env.LUMEO_API_KEY!,
	defaultHeaders: { 'x-app-version': '1.2.0' },
	onRequest: ({ method, url, attempt }) => {
		console.log('[SDK request]', method, url, attempt);
	},
	onResponse: ({ status, durationMs, requestId }) => {
		console.log('[SDK response]', status, durationMs, requestId);
	},
	onError: ({ error, durationMs }) => {
		console.error('[SDK error]', durationMs, error);
	},
});

Auth and idempotency behavior

  • Every request adds Authorization: Bearer {apiKey}.
  • POST, PUT, PATCH requests auto-add Idempotency-Key (UUID v4).
  • Override per request via options:
await client.vaults.create(
	{ ownerId: 'org_123', label: 'Main INR', currency: 'INR' },
	{ idempotencyKey: 'invoice-3491-create-vault' },
);

API reference

vaults

| Method | Description | |---|---| | create(params, opts?) | Create a programmable inbound payment vault | | get(vaultId, opts?) | Get vault by ID | | list(params?, opts?) | List vaults with cursor pagination | | listAutoPaginate(params?) | Async iterator over all vault pages | | update(vaultId, params, opts?) | Update vault metadata / settlement rule ref | | deactivate(vaultId, opts?) | Soft-deactivate vault | | getBalance(vaultId, opts?) | Get real-time vault balance snapshot | | attachRule(vaultId, ruleId, opts?) | Attach rule to vault | | detachRule(vaultId, ruleId, opts?) | Detach rule from vault | | sweep(vaultId, params, opts?) | Trigger manual settlement sweep |

rules

| Method | Description | |---|---| | create(params, opts?) | Create a new Contract Engine rule | | get(ruleId, opts?) | Get rule by ID | | list(params?, opts?) | List rules with cursor pagination | | listAutoPaginate(params?) | Async iterator over all rules | | update(ruleId, params, opts?) | Update rule | | delete(ruleId, opts?) | Delete rule | | validate(dsl, opts?) | Validate DSL (local + API validator) | | simulate(ruleId, params, opts?) | Simulate rule execution with sample payload |

transactions

| Method | Description | |---|---| | list(params?, opts?) | List transactions | | listAutoPaginate(params?) | Async iterator over all transaction pages | | get(transactionId, opts?) | Get transaction by ID | | refund(transactionId, params, opts?) | Initiate refund | | getTimeline(transactionId, opts?) | Get transaction audit timeline |

beneficiaries

| Method | Description | |---|---| | create(params, opts?) | Create beneficiary | | get(beneficiaryId, opts?) | Get beneficiary | | list(params?, opts?) | List beneficiaries | | listAutoPaginate(params?) | Async iterator over all beneficiary pages | | update(beneficiaryId, params, opts?) | Update beneficiary | | delete(beneficiaryId, opts?) | Delete beneficiary | | verify(beneficiaryId, params?, opts?) | Trigger bank account verification |

compliance

| Method | Description | |---|---| | upload(params, opts?) | Upload compliance document (multipart) | | get(documentId, opts?) | Get compliance document | | list(params?, opts?) | List compliance documents | | listAutoPaginate(params?) | Async iterator over all compliance doc pages | | getStatus(documentId, opts?) | Get document status | | requestResubmission(documentId, params, opts?) | Request resubmission |

Rule DSL guide

1) Split 30% to GST account on inbound > ₹50,000

const dsl: RuleDSL = {
	version: '1.0',
	trigger: {
		event: 'inbound_payment',
		conditions: [{ field: 'amountRaw', operator: 'gt', value: 5_000_000 }],
	},
	actions: [
		{
			type: 'split',
			splits: [
				{ beneficiaryId: 'bene_ops', percentage: 70 },
				{ beneficiaryId: 'bene_gst', percentage: 30 },
			],
		},
	],
};

2) Escrow release after 7 days

const dsl: RuleDSL = {
	version: '1.0',
	trigger: { event: 'inbound_payment' },
	actions: [
		{
			type: 'escrow',
			releaseCondition: { field: 'ageDays', operator: 'gte', value: 7 },
		},
	],
};

3) Scheduled sweep to treasury wallet

const dsl: RuleDSL = {
	version: '1.0',
	trigger: { event: 'schedule' },
	actions: [
		{
			type: 'sweep',
			destination: 'wallet:treasury_main',
			currency: 'INR',
		},
	],
};

Webhook guide

Use webhook helpers to verify HMAC signatures and parse typed events.

import { constructWebhookEvent } from '@lumeo/sdk';

const rawBody = requestRawBody; // string | Uint8Array | ArrayBuffer
const signature = req.headers['x-lumeo-signature'] as string;
const secret = process.env.LUMEO_WEBHOOK_SECRET!;

const event = await constructWebhookEvent(rawBody, signature, secret);

switch (event.type) {
	case 'payment.received':
		console.log(event.payload.transactionId, event.payload.amountRaw);
		break;
	case 'compliance.status_changed':
		console.log(event.payload.currentStatus);
		break;
}

Supported event types:

  • vault.created
  • payment.received
  • rule.triggered
  • settlement.completed
  • compliance.status_changed
  • sweep.initiated
  • sweep.completed

Error handling

All SDK errors inherit from LumeoError.

| Error class | Typical status | |---|---| | LumeoAuthError | 401, 403 | | LumeoRateLimitError | 429 | | LumeoValidationError | 400, 409, 422 | | LumeoAPIError | Other non-2xx API errors |

import {
	LumeoAuthError,
	LumeoRateLimitError,
	LumeoValidationError,
} from '@lumeo/sdk';

try {
	await client.vaults.get('vault_123');
} catch (error) {
	if (error instanceof LumeoAuthError) {
		// refresh or rotate API key
	} else if (error instanceof LumeoRateLimitError) {
		// use retryAfterSeconds for backoff
	} else if (error instanceof LumeoValidationError) {
		// fix payload
	}
}

TypeScript usage notes

  • SDK is fully typed and built with strict TypeScript settings.
  • ESM and CJS builds are both published.
  • No runtime dependencies are required.
  • LumeoClient is available as both default and named export.

Local development

npm run typecheck
npm run test
npm run build

Release and publish

npm run prepublishOnly
npm pack --dry-run

Publish manually (PowerShell):

$env:NODE_AUTH_TOKEN="YOUR_NPM_TOKEN"; npm publish --access public

See docs/RELEASE.md for the full end-to-end release checklist, CI tag flow, and troubleshooting.