Installation & Configuration
The official Node.js SDK for the Felloh payments API. Use it to manage bookings, transactions, payment links, and all other Felloh resources from your server.
Installation
The SDK requires Node.js 18 or later.
Install the SDK
npm install @felloh-org/node-sdk
Quick Start
Import the FellohClient class and create an instance with your API keys. The client handles authentication, token
management, retries, and pagination automatically.
Your API keys can be created and managed from the Felloh dashboard. See the API Keys resource for managing keys programmatically.
Quick Start
import { FellohClient } from '@felloh-org/node-sdk';
const client = new FellohClient({
publicKey: process.env.FELLOH_PUBLIC_KEY,
privateKey: process.env.FELLOH_PRIVATE_KEY,
});
// List bookings
const bookings = await client.bookings.list({
organisation: 'your-org-id',
});
console.log(bookings.data);
Configuration Options
The FellohClient constructor accepts a configuration object with the following options.
Parameters
- Name
publicKeyrequired- Type
- string
- Description
Your Felloh public API key.
- Name
privateKeyrequired- Type
- string
- Description
Your Felloh private API key.
- Name
baseUrl- Type
- string
- Description
Base URL for the Felloh API. Defaults to
https://api.felloh.com.
- Name
timeout- Type
- integer
- Description
Request timeout in milliseconds. Defaults to
30000(30 seconds).
- Name
maxRetries- Type
- integer
- Description
Number of automatic retries on 5xx or network errors. Defaults to
2. Uses exponential backoff.
- Name
tokenRefreshBuffer- Type
- integer
- Description
Seconds before token expiry to proactively refresh. Defaults to
60.
- Name
logger- Type
- function
- Description
Optional callback invoked after every HTTP request for logging and observability. Receives a
LogEntryobject.
Full Configuration
import { FellohClient } from '@felloh-org/node-sdk';
const client = new FellohClient({
publicKey: 'your-public-key',
privateKey: 'your-private-key',
baseUrl: 'https://api.felloh.com',
timeout: 30000,
maxRetries: 2,
tokenRefreshBuffer: 60,
logger: (entry) => {
console.log(
`${entry.method} ${entry.url} → ${entry.statusCode} (${entry.durationMs}ms)`
);
},
});
Token Management
The SDK automatically handles JWT token acquisition and refresh. Tokens are cached in memory and proactively refreshed
before expiry based on the tokenRefreshBuffer setting. No manual token management is needed.
If a request receives a 401 response, the SDK will automatically refresh the token and retry the request once.
Available Resources
Every resource on the Felloh API is accessible through a property on the client instance.
| Resource | Client Property | Documentation |
|---|---|---|
| Organisations | client.organisations | Organisations |
| Bookings | client.bookings | Bookings |
| Booking Components | client.bookingComponents | Booking Components |
| Transactions | client.transactions | Transactions |
| Customers | client.customers | Customers |
| Payment Links | client.paymentLinks | Payment Links |
| Ecommerce | client.ecommerce | Ecommerce |
| Refunds | client.refunds | Refunds |
| Charges | client.charges | Charges |
| Chargebacks | client.chargebacks | Chargebacks |
| Credit Notes | client.creditNotes | Credit Notes |
| Suppliers | client.suppliers | Suppliers |
| Beneficiaries | client.beneficiaries | Beneficiaries |
| Disbursements | client.disbursements | Disbursements |
| Ledger | client.ledger | Ledger |
| Acquirer Settlement | client.batches | Acquirer Settlement |
| API Keys | client.apiKeys | API Keys |
| Audit | client.audit | Audit |
| AISP | client.aisp | AISP |
| Scheduled Payments | client.scheduledPayments | Scheduled Payments |
| Enums | client.enums | Enums |
