Skip to main content

Installation

npm install @bfinance/sdk

Initialization

  • Configuration object
import { BFinance } from "@bfinance/sdk";

const client = new BFinance({
    baseUrl: "https://business.bfinance.app",
    apiToken: "YOUR_BEARER_TOKEN",
    timeoutMs?: 3000,
    headers?: {
        "Content-Type: application/json",
    }
});
Config fields
  • baseUrl (required) — API base URL
  • apiToken (required) — Bearer token
  • timeoutMs (optional) — request timeout in ms
  • headers (optional) — custom headers
  • logging (optional) — request/response logging
logging: {
    level: "info",
    includeBody: false,
    includeHeaders: false,
},
  • Authentication
The SDK uses Bearer token authorization for all requests:
  • Header: Authorization: Bearer 
Keep credentials secure and do not expose tokens in client-side apps. https://www.npmjs.com/package/@bfinance/sdk