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

# ChainPatrolClient Constructor

> Instantiate a new ChainPatrolClient with your API key and optional baseUrl to connect the JavaScript SDK to ChainPatrol's threat detection API.

## Example

```ts theme={null}
import { ChainPatrolClient } from "@chainpatrol/sdk";

const chainpatrol = new ChainPatrolClient({ apiKey: "<API_KEY>" });
```

## Parameters

**options** `object` *required*

**properties**

**apiKey** `string`

The `apiKey` property is the API Key for accessing ChainPatrol's APIs. We
recommend using an environment variable to store your API Key.

**baseUrl** `string`

The `baseUrl` property is an optional property that specifies the API URL. You
only need to specify this if you are using a proxy server.

Defaults to `https://app.chainpatrol.io/api/`. The client adds `v2/...` to
this address itself, so don't include `v2` in the value you pass.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.