> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/configsnapshot.md).

# ConfigSnapshot

ConfigSnapshot : `Instance`

## Overview

ConfigSnapshot is an object returned by ConfigService's GetConfigAsync() or GetConfigForPlayerAsync() that holds the config values at a specific point in time.

The values held by a ConfigSnapshot do not change until you call Refresh(). When new values are prepared because the config values were updated or a testing value changed, Outdated becomes true and the UpdateAvailable event fires; calling Refresh() applies the prepared values all at once.

ConfigSnapshot can only be used in server Scripts. A ConfigSnapshot that is no longer referenced by any script is removed automatically, and it also stops checking for new versions.

## Properties

### Error

`Enum.ConfigSnapshotError`

A read-only property that returns whether an error occurred during the most recent attempt to check for or load new config values.

If loading fails, it becomes LoadFailed, and the values already applied to the ConfigSnapshot are kept as they are. When a later load succeeds, it becomes None again.

#### Code Samples

### Outdated

`boolean`

A read-only property that returns whether there are config values newer than those applied to the ConfigSnapshot.

It is true if new values that have not been applied yet are prepared, or if a new version of the config values has been detected but not loaded yet. It becomes false when you apply the prepared values with Refresh().

#### Code Samples

## Methods

### GetValue

Returns the value for the specified key among the config values currently applied to the ConfigSnapshot.

Table values are returned as copies, so modifying a returned table does not change the value stored in the ConfigSnapshot.

#### Parameters

| `Value` Key | <p>The key of the config value to read.</p><ul><li>It must be a string of 1 to 250 characters consisting of letters, digits, <code>.</code>, <code>-</code>, and <code>*</code>, and cannot start with <code>*</code>.</li><li>Passing a key that does not follow these rules raises an error.</li></ul> |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

#### Return

| `Value` | The config value for the key. It is a string, boolean, number, or table, and is nil if the key does not exist. |
| ------- | -------------------------------------------------------------------------------------------------------------- |

#### Code Samples

### GetValueChangedSignal

Returns a signal that fires when the value of the specified key is changed by Refresh().

It fires only when the key's value was added, removed, or changed as new values are applied by Refresh(), and the new value is passed to the connected function (nil if the key was removed). By the time the signal fires, the new values of all keys have already been applied. Calling this method multiple times with the same key returns the same signal.

#### Parameters

| `Value` Key | <p>The key of the config value to watch for changes.</p><ul><li>It must be a string of 1 to 250 characters consisting of letters, digits, <code>.</code>, <code>-</code>, and <code>*</code>, and cannot start with <code>*</code>.</li><li>Passing a key that does not follow these rules raises an error.</li></ul> |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

#### Return

| `ScriptSignal` | A signal that fires when the key's value changes. |
| -------------- | ------------------------------------------------- |

#### Code Samples

### Refresh

Applies the prepared new config values to the ConfigSnapshot.

After the values are applied, the signal obtained from GetValueChangedSignal() fires for each key whose value changed. If no new values are prepared, this method does nothing. This method does not load new values itself; it only applies the values announced by the UpdateAvailable event.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

## Events

### UpdateAvailable

An event that fires when new config values that can be applied to the ConfigSnapshot are prepared.

Even when this event fires, the values returned by GetValue() do not change immediately; the new values are applied only after you call Refresh().

#### Parameters

#### Code Samples
