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

# allow()

> Add a URL or domain to the ThreatDetector local allowlist so subsequent url() checks return an ALLOWED status without calling the ChainPatrol API.

> [!WARNING]
>
> We recommend only using this method in `local` mode to populate new entries
> in the allowlist. In `cloud` mode, the allowlist is populated automatically.

## Example

```js Code theme={null}
await detector.allow("google.com");

console.log(await detector.url("https://google.com"));
```

```js Output theme={null}
{
    ok: true,
    url: "google.com",
    status: "ALLOWED"
}
```

## Parameters

**url** `string` *required*

The URL to allow. This can be a full URL or a domain.

Ex. `https://google.com` or `google.com`

## Return Value

The return value is a promise that resolves with a result object.

### Success

If the addition was successful, the object will contain the following properties:

**result** `object` *required*

**properties**

**ok** `true` *required*

This property will be `true` if the addition was successful.

**url** `string`

The `url` property is the URL that was added.

### Failure

However, if the addition was unsuccessful, the object will contain the following:

**result** `object` *required*

**properties**

**ok** `false` *required*

This property will be `false` if the addition was unsuccessful.

**url** `string`

The `url` property is the URL that we tried to add.

**error** `string`

The `error` property will contain a human-readable error message.


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