---
title: ConfigStore
summary: A Compute Config Store.
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/config_store/class.ConfigStore/
---

**Kind:** Class  
**Module:** [config_store](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/config_store/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/config_store.h#L13

Include `fastly/config_store.h` to use this class.

A Compute Config Store.

## Methods

### contains

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/config_store.h#L56

```cpp
fastly::expected<bool> fastly::config_store::ConfigStore::contains(std::string_view key)
```

Return true if the [config_store](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/config_store/) contains an entry with the given key.

###### Examples

**Parameters**

- `key`: `std::string_view`

**Returns**

`fastly::expected<bool>`

```cpp
 _run
auto store{fastly::ConfigStore::open("test config store")};
assert(store.contains("key").value());
```

### get

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/config_store.h#L46

```cpp
fastly::expected<std::optional<std::string>> fastly::config_store::ConfigStore::get(std::string_view key)
```

Lookup a value in this config store.

If successful, this function returns `std::optional<std::string>>` if an entry was found, or `std::nullopt` if no entry with the given key was found.

###### Examples

**Parameters**

- `key`: `std::string_view`

**Returns**

`fastly::expected<std::optional<std::string>>`

```cpp
 _run
auto store{fastly::ConfigStore::open("test config store")};
assert(store.get("bread").value() ==
       "a usually baked and leavened food");

assert(
    store.get("freedom").value() ==
    "the absence of necessity, coercion, or constraint",
);

// Otherwise, `get` will return nullopt.
assert(store.get("zzzzz") == std::nullopt);
```

### open

**Flags:** static  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/config_store.h#L23

```cpp
static fastly::expected<ConfigStore> fastly::config_store::ConfigStore::open(std::string_view name)
```

Open a config store, given its name.

###### Examples

**Parameters**

- `name`: `std::string_view`

**Returns**

`fastly::expected<ConfigStore>`

```cpp
 _run
auto merriam{fastly::ConfigStore::open("merriam webster")};
auto oed{fastly::ConfigStore::open("oxford english config store")};
```
