Skip to main content

Install

npm install @trusset/sdk
Requires Node.js 18 or later. The package ships dual CJS/ESM builds with full TypeScript declarations.

Initialize

import { TrussetClient } from '@trusset/sdk'

const trusset = new TrussetClient({
  apiKey: 'tsk_live_...',
})
The API key determines which instance the client operates against. Create and manage keys in the Issuer Platform under your instance settings.
Store API keys in environment variables or a secrets manager. Never commit them to source control.

Configuration

All options beyond apiKey are optional.
apiKey
string
required
Instance API key from the Issuer Platform. Minimum 20 characters.
baseUrl
string
default:"https://api.trusset.org"
API base URL. Override only if directed by Trusset support.
timeoutMs
number
default:30000
Request timeout in milliseconds. Increase for batch operations or slow networks.
maxRetries
number
default:3
Maximum retry attempts on transient failures (5xx, 408, 429, network errors). Set to 0 to disable retries.
logger
Logger
Custom logger implementing debug, info, warn, and error methods. Defaults to silent. Pass console for quick debugging.
const trusset = new TrussetClient({
  apiKey: process.env.TRUSSET_API_KEY!,
  timeoutMs: 60_000,
  maxRetries: 5,
  logger: console,
})

CommonJS usage

The SDK works with require for Node.js backends that don’t use ES modules.
const { TrussetClient } = require('@trusset/sdk')

const trusset = new TrussetClient({
  apiKey: process.env.TRUSSET_API_KEY,
})

Module structure

After initialization, product modules are available as properties on the client. Each module groups related operations.
trusset.customers          // Customer lifecycle
trusset.customers.manage   // CRUD, search, wallet linking
trusset.customers.identity // On-chain KYC verification
trusset.customers.idLinks  // KYC verification links
trusset.customers.sync     // Bulk database import/export
Additional modules (tokenization, trading, lending) will follow the same pattern as they become available.