---
title: ConfigStore
summary: Interface to Fastly Config Store.
url: https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/config_store/class.ConfigStore/
---

**Kind:** Class  
**Module:** [config_store](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/config_store/)  
**Package:** fastly-compute 0.1.3  
**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/config_store.py#L26

Extends `FastlyResource[wit_config_store.Store]`.

Interface to Fastly Config Store.

Config Stores provide read-only access to configuration data that can be
updated without redeploying your service.

```python
with ConfigStore.open("app-config") as config:
    api_url = config.get("api_url", "https://api.example.com")
```

## Methods

### __contains__

**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/config_store.py#L74

```python
__contains__(key: str) -> bool
```

Check if a key exists in the config store.

**Parameters**

- `key`: `str` — The configuration key

**Returns**

`bool`

True if the key exists, False otherwise

**Throws**

- [InvalidArgument](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/error/class.InvalidArgument/) — If the key is invalid
- [KeyError](https://docs.python.org/3/library/exceptions.html#KeyError) — If the key is not a str

```python
config = ConfigStore.open("app-config")
if "feature_flag" in config:
    print("Feature flag exists")
```

### get

**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/config_store.py#L55

```python
get(key: str, default: str | None = None) -> str | None
```

Get a configuration value.

**Parameters**

- `key`: `str` — The configuration key
- `default`: `str | None` (optional) = `None` — Default value if key not found

**Returns**

`str | None`

Configuration value or default if not found

**Throws**

- [InvalidArgument](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/error/class.InvalidArgument/) — If the key is invalid

```python
config = ConfigStore.open("app-config")
api_url = config.get("api_url", "https://api.example.com")
```

### open

**Flags:** static  
**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/config_store.py#L39

```python
open(name: str) -> Self
```

Open a config store by name.

**Parameters**

- `name`: `str` — The name of the config store

**Returns**

`Self`

ConfigStore instance

**Throws**

- [NotFound](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.NotFound/) — If the config store doesn't exist
- [InvalidSyntax](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.InvalidSyntax/) — If the name is invalid
- [NameTooLong](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/exceptions/types/open_error/class.NameTooLong/) — If the name is too long

```python
config = ConfigStore.open("my-config")
```
