---
title: Dictionary
summary: Class for accessing Fastly Edge Dictionaries.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/dictionary/class.Dictionary/
---

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

> **DEPRECATED:** Use ConfigStore from `'fastly:config-store'` instead.

Class for accessing [Fastly Edge Dictionaries](https://docs.fastly.com/en/guides/about-edge-dictionaries).

**Note**: Can only be used when processing requests, not during build-time initialization.

## Constructor

**Flags:** deprecated  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/dictionary.d.ts#L21

> **DEPRECATED:** Use ConfigStore from `'fastly:config-store'` instead.

```javascript
new Dictionary(name: string)
```

Creates a new Dictionary object, providing access to the named
[Edge Dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries).

**Parameters**

- `name`: `string` — The name of the Edge Dictionary.

**Throws**

- `TypeError` if no Dictionary exists with the provided name.
- `TypeError` if the provided name is empty, longer than 255 characters,
  does not start with an ASCII alphabetical character, or contains characters
  other than ASCII alphanumerics, underscores, and spaces.

## Methods

### get

**Flags:** deprecated  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/dictionary.d.ts#L30

> **DEPRECATED:** Use ConfigStore from `'fastly:config-store'` instead.

```javascript
get(key: string): string | null
```

Get a value for a key in the Dictionary. If the provided key does not
exist in the Dictionary then this returns `null`.

**Parameters**

- `key`: `string` — The key to retrieve.

**Returns**

`string | null`

**Throws**

- `TypeError` if the provided key is empty or longer than 255 characters.
