Start here

Start here to install the Lombard SDK, configure the environment, and make the first API calls.


Installation

npm install @lombard.finance/sdk

Peer Dependencies

npm install viem@^2.23.15 axios@^1 bignumber.js@^9 @bitcoinerlab/[email protected] [email protected]

Configuration

Create the config once and reuse it throughout theyour application.

// lib/lombard.ts
import { createConfig, Env } from '@lombard.finance/sdk';

export const config = createConfig({
  env: Env.testnet,
  partner: {
    partnerId: 'test',  // See Partners guide for production setup
  },
  providers: {
    evm: () => window.ethereum,
  },
});

Tip: Export theyour config from a central file (e.g., lib/lombard.ts) and import it wherever the you need SDK functionality is needed.


Configuration Options

Option
Type
Required
Description

env

Env

Yes

Environment (prod, testnet, dev)

providers

ProviderGetters

No

Wallet provider functions

partner

PartnerConfig

No

Partner configuration

modules

AnyModule[]

No

Custom modules


Two Ways to Use the SDK

Both approaches use the same config object.

Full SDK Object

Best for exploring all capabilities in one place.

Modular Factories

Best for production builds. Only import what you use for optimal tree-shaking.Import only the required modules to enable optimal tree-shaking.


First API Calls

The SDK provides data-fetching methods via sdk.api.*:

Last updated