> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the SDK, initialize a client, and configure options

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @trusset/sdk
  ```

  ```bash yarn theme={null}
  yarn add @trusset/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @trusset/sdk
  ```
</CodeGroup>

Requires Node.js 18 or later. The package ships dual CJS/ESM builds with full TypeScript declarations.

## Initialize

```typescript theme={null}
import { TrussetClient } from '@trusset/sdk'

const trusset = new TrussetClient({
  apiKey: 'trusset_...',
})
```

The API key determines which [instance](/protocol/infrastructure/instances) the client operates against - development instances run on Sepolia, production instances on Ethereum mainnet. Create and manage keys in the [Issuer Platform](https://issuers.trusset.org) under your instance settings.

<Warning>
  Store API keys in environment variables or a secrets manager. Never commit them to source control.
</Warning>

## Configuration

All options beyond `apiKey` are optional.

<ParamField body="apiKey" type="string" required>
  Instance API key from the Issuer Platform. Keys start with `trusset_`.
</ParamField>

<ParamField body="baseUrl" type="string" default="https://api.trusset.org">
  API base URL. Override only if directed by Trusset support.
</ParamField>

<ParamField body="timeoutMs" type="number" default={30000}>
  Request timeout in milliseconds. Increase for batch operations or slow networks. On-chain write methods enforce higher floors regardless (180s; proof claims 420s), because the backend waits for block confirmations inside the request.
</ParamField>

<ParamField body="maxRetries" type="number" default={3}>
  Maximum retry attempts on transient failures. Applies to read requests (5xx, 408, 429, network errors); write requests retry only on 429. Set to `0` to disable retries.
</ParamField>

<ParamField body="logger" type="Logger">
  Custom logger implementing `debug`, `info`, `warn`, and `error` methods. Defaults to silent. Pass `console` for quick debugging.
</ParamField>

```typescript theme={null}
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.

```javascript theme={null}
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.

```typescript theme={null}
trusset.customers          // Customer lifecycle
trusset.customers.manage   // CRUD, search, wallet linking
trusset.customers.identity // On-chain KYC verification and claims
trusset.customers.idLinks  // KYC verification links
trusset.customers.profiles // Verification profiles (beta)
trusset.customers.sync     // Bulk database import/export
```

Additional modules (`tokenization`, `trading`, `lending`) will follow the same pattern as they become available.
