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

# Authenticating with the FusionDesk SDK

> Initialize the FusionDesk SDK with your API key to authenticate all requests automatically.

Authentication in the FusionDesk SDK is handled once globally at initialization time. You pass your API key to `initializeSdk`, and every subsequent request made by the SDK automatically includes that key in the `X-API-KEY` header.

***

## Initializing the SDK

Initialize the SDK state at application startup. The example below reads the API key from environment variables.

```typescript JavaScript / TypeScript theme={null}
import { initializeSdk } from 'fusiondesk-sdk';

initializeSdk(process.env.FUSIONDESK_API_KEY, {
  baseUrl: 'https://api.fusiondesk.dev'
});
```

***

## API Key Format

All FusionDesk API keys follow a specific structured format verified by the SDK's validation engine:

```text theme={null}
[type].[classification].[hex-string]
```

* **Type**: `org` (organization-level key) or `customer` (customer-level key).
* **Classification**: `pk` (public key) or `sk` (secret key).
* **Hex String**: A 32-character hexadecimal key.

Example valid public key:
`org.pk.0123456789abcdef0123456789abcdef`
