> For the complete documentation index, see [llms.txt](https://docs.dotpassport.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dotpassport.io/api-client/initialization.md).

# Initialization

Learn how to initialize the DotPassportClient.

## Basic Initialization

```typescript
import { DotPassportClient } from '@dotpassport/sdk';

const client = new DotPassportClient({
  apiKey: 'live_your_api_key_here'
});
```

## Configuration Options

```typescript
interface DotPassportConfig {
  apiKey: string;      // Required: Your API key
  baseUrl?: string;    // Optional: API base URL
}
```

### API Key

Your authentication key. Get it from the [developer dashboard](https://dotpassport.com/developers).

```typescript
const client = new DotPassportClient({
  apiKey: process.env.DOTPASSPORT_API_KEY!
});
```

### Base URL

Override the default API URL (useful for testing):

```typescript
const client = new DotPassportClient({
  apiKey: 'test_key',
  baseUrl: 'https://api-staging.dotpassport.com'
});
```

## Environment-Specific Setup

### Development

```typescript
const client = new DotPassportClient({
  apiKey: process.env.DOTPASSPORT_TEST_KEY!,
  baseUrl: 'https://api-staging.dotpassport.com'
});
```

### Production

```typescript
const client = new DotPassportClient({
  apiKey: process.env.DOTPASSPORT_LIVE_KEY!
});
```

## Singleton Pattern

Create a single instance for your entire application:

```typescript
// lib/dotpassport.ts
import { DotPassportClient } from '@dotpassport/sdk';

export const dotpassport = new DotPassportClient({
  apiKey: process.env.DOTPASSPORT_API_KEY!
});

// Usage in other files
import { dotpassport } from './lib/dotpassport';

const scores = await dotpassport.getScores(address);
```

## Next Steps

* [Profile Methods](/api-client/profile.md)
* [Scores Methods](https://github.com/dotpassport/dotpassport-sdk/blob/main/docs/api-client/scores.md)
* [Error Handling](https://github.com/dotpassport/dotpassport-sdk/blob/main/docs/api-client/error-handling.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dotpassport.io/api-client/initialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
