---
title: Acl
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/acl/class.Acl/
---

**Kind:** Class  
**Module:** [acl](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/acl/)  
**Package:** @fastly/js-compute 4.0.1  
**Since:** 3.32.0  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/acl.d.ts#L7

## Methods

### lookup

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/acl.d.ts#L27

```javascript
lookup(ipAddress: string): Promise<{ action: 'ALLOW' | 'BLOCK'; prefix: string } | null>
```

Lookup a given IP address in the ACL list.

**Parameters**

- `ipAddress`: `string` — Ipv6 or IPv4 IP address string

**Returns**

`Promise<{ action: 'ALLOW' | 'BLOCK'; prefix: string } | null>`

An object containing the ACL action and IP prefix if the given IP address matches an ACL entry, or null if there is no match.

```javascript
import { Acl } from 'fastly:acl';
addEventListener('fetch', async (evt) => {
  const myAcl = Acl.open('myacl');
  const result = await myAcl.lookup(evt.client.address);
  evt.respondWith(new Response(result?.action === 'BLOCK' ? 'blocked' : 'allowed'));
});
```

### open

**Flags:** static  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/acl.d.ts#L11

```javascript
static open(aclName: string): Acl
```

Opens the given ACL store by name

**Parameters**

- `aclName`: `string`

**Returns**

`Acl`
