# Client (https://dev.cosmospay.lat/docs/sdk/definitions/server/client/)

> The main entry point of the SDK — a single, atomic client that exposes every resource through its own manager — an atomic, single-client design.

The main entry point of the SDK — a single, atomic client that exposes every resource through its own manager — an atomic, single-client design.

## Constructor

### Client

```ts
constructor(options: ClientOptions)
```

**Parameters**

- `options`: `ClientOptions`

## Properties

### version

Library version.

```ts
static readonly version = "2.3.2"
```

### shared

Process-wide shared defaults maintained by Cosmos Pay (gateway URL, version, internal secrets). Mutate once at startup to change them for every client (e.g. self-hosting): `Client.shared.baseURL = 'https://gateway.your-domain.com'`.

```ts
static readonly shared: SharedConfig
```

### shared

Resolved shared configuration for this client instance.

```ts
readonly shared: SharedConfig
```

### webhookSecret

Default webhook signing secret for the webhook listener (if configured).

```ts
webhookSecret: string | undefined
```

### rest

The underlying HTTP layer. Shared by every manager.

```ts
readonly rest: REST
```

**Type** [`REST`](https://dev.cosmospay.lat/docs/sdk/definitions/server/rest/)

### paymentIntents

Stellar payment intents — create/list/fetch/update/delete/validate.

```ts
readonly paymentIntents: PaymentIntentManager
```

**Type** [`PaymentIntentManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/payment-intent-manager/)

### webhooks

Webhook endpoints, delivery audit trail, and the event listener.

```ts
readonly webhooks: WebhookManager
```

**Type** [`WebhookManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/webhook-manager/)

### products

Products / prices.

```ts
readonly products: ProductManager
```

**Type** [`ProductManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/product-manager/)

### swaps

Same-chain swaps: the Stellar DEX, Jupiter on Solana, Kuru Flow on Monad.

```ts
readonly swaps: SwapManager
```

**Type** [`SwapManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/swap-manager/)

### crossChainSwaps

Swaps between Stellar, Solana and Monad, settled by NEAR Intents.

```ts
readonly crossChainSwaps: CrossChainSwapManager
```

**Type** [`CrossChainSwapManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/cross-chain-swap-manager/)

### usdt0

USDT0 from Stellar to EVM networks through LayerZero (mainnet only).

```ts
readonly usdt0: Usdt0Manager
```

**Type** [`Usdt0Manager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/usdt0-manager/)

### privatePayments

Private payments: amounts hidden on-chain (Stellar testnet only for now).

```ts
readonly privatePayments: PrivatePaymentManager
```

**Type** [`PrivatePaymentManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/private-payment-manager/)

### liquidity

Liquidity pools: browse, positions, deposit / withdraw.

```ts
readonly liquidity: LiquidityManager
```

**Type** [`LiquidityManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/liquidity-manager/)

### onramp

Fiat -> stablecoin: quotes, payins, trustlines, virtual accounts.

```ts
readonly onramp: OnrampManager
```

**Type** [`OnrampManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/onramp-manager/)

### offramp

Stablecoin -> fiat: quotes, authorize, payouts, compliance documents.

```ts
readonly offramp: OfframpManager
```

**Type** [`OfframpManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/offramp-manager/)

### activity

The client event stream: report events, read them back, summarize.

```ts
readonly activity: ActivityManager
```

**Type** [`ActivityManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/activity-manager/)

### kyc

KYC / KYB: receivers, their wallets and their bank accounts.

```ts
readonly kyc: KycManager
```

**Type** [`KycManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/kyc-manager/)

### customers

Customers and their wallets.

```ts
readonly customers: CustomerManager
```

**Type** [`CustomerManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/customer-manager/)

### analytics

Read-only analytics (summary, series, balances, logs).

```ts
readonly analytics: AnalyticsManager
```

**Type** [`AnalyticsManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/analytics-manager/)

### health

Service health probes (public).

```ts
readonly health: HealthManager
```

**Type** [`HealthManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/health-manager/)

### aliases

Payment handles: resolve, claim and manage `@name` aliases.

```ts
readonly aliases: AliasManager
```

**Type** [`AliasManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/alias-manager/)

### assets

The asset registry: which `(code, issuer)` pairs exist per network, and who issues them.

```ts
readonly assets: AssetManager
```

**Type** [`AssetManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/asset-manager/)

### plugins

Plugins this deployment serves: install, query, command.

```ts
readonly plugins: PluginManager
```

**Type** [`PluginManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/plugin-manager/)

### defindex

DeFindex vaults (when the deployment enables the native plugin).

```ts
readonly defindex: DefindexManager
```

**Type** [`DefindexManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/defindex-manager/)

### publicKey

The shared public API key an open-source wallet embeds.

```ts
readonly publicKey: PublicKeyManager
```

**Type** [`PublicKeyManager`](https://dev.cosmospay.lat/docs/sdk/definitions/server/public-key-manager/)

## Methods

### setApiKey()

Update the API key used for subsequent requests.

```ts
setApiKey(apiKey: string): this
```

**Parameters**

- `apiKey`: `string`

**Returns** `this`

### setWebhookSecret()

Set the default webhook signing secret for the webhook listener.

```ts
setWebhookSecret(secret: string): this
```

**Parameters**

- `secret`: `string`

**Returns** `this`

## Related

- [REST](https://dev.cosmospay.lat/docs/sdk/definitions/server/rest/)
- [PaymentIntentManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/payment-intent-manager/)
- [WebhookManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/webhook-manager/)
- [ProductManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/product-manager/)
- [SwapManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/swap-manager/)
- [CrossChainSwapManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/cross-chain-swap-manager/)
- [Usdt0Manager](https://dev.cosmospay.lat/docs/sdk/definitions/server/usdt0-manager/)
- [PrivatePaymentManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/private-payment-manager/)
- [LiquidityManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/liquidity-manager/)
- [OnrampManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/onramp-manager/)
- [OfframpManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/offramp-manager/)
- [ActivityManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/activity-manager/)
- [KycManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/kyc-manager/)
- [CustomerManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/customer-manager/)
- [AnalyticsManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/analytics-manager/)
- [HealthManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/health-manager/)
- [AliasManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/alias-manager/)
- [AssetManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/asset-manager/)
- [PluginManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/plugin-manager/)
- [DefindexManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/defindex-manager/)
- [PublicKeyManager](https://dev.cosmospay.lat/docs/sdk/definitions/server/public-key-manager/)
