> ## 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.

# ChainPatrol JavaScript SDK Overview

> The ChainPatrol JavaScript SDK provides ThreatDetector, Relay, Storage, and API client tools to protect your app's users from phishing and scam URLs.

**Phishing** and **scam URLs** are a huge problem online.
To make it easier for wallet, dApp, and other security-conscious app builders to
protect their users from these threats, we've built a JavaScript SDK that you can use to
interact with our threat detection APIs.

```js theme={null}
import { ThreatDetector } from "@chainpatrol/sdk";

const detector = new ThreatDetector({
  mode: "cloud",
  apiKey: "YOUR_API_KEY",
});

const result = await detector.url("https://scam-site.com");
```

## Installation

> [tab] npm
>
> ```bash theme={null}
> npm install --save @chainpatrol/sdk
> ```

> [tab] yarn
>
> ```bash theme={null}
> yarn add @chainpatrol/sdk
> ```

> [tab] pnpm
>
> ```bash theme={null}
> pnpm add @chainpatrol/sdk
> ```

## Features

> [card] TypeScript support
>
> Written in TypeScript with full type definitions

> [card] Cross-platform
>
> Works in all modern browsers, Node.js, and browser extensions

> [card] Lightweight
>
> Minimal dependencies

> [card] Built for scale
>
> Designed with caching and rate-limiting built-in

## Exports

| Name | Description |
| :- | :- |
| [ThreatDetector](./threat-detector) | A simple interface for detecting phishing URLs |
| [Storage](./storage) | Storage cache implementation for ThreatDetector |
| [Relay](./relay) | A message relay for sharing events between browser extension contexts |
| [ChainPatrolClient](./chainpatrol-client) | Used to create a client that connects to the ChainPatrol API |


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