> 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/configservice.md).

# ConfigService

ConfigService : `Instance`

## Overview

ConfigService is a service that lets server scripts read the config values set for the world.

Calling GetConfigAsync() or GetConfigForPlayerAsync() returns a ConfigSnapshot that holds the config values at that point in time, and you read values with the ConfigSnapshot's GetValue(). When the config values are later updated, the ConfigSnapshot's UpdateAvailable event fires, and the new values are applied only after you call Refresh().

This service can only be used in server Scripts, and calling it from a LocalScript raises an error.

**Important Notes**

* Studio does not load actual config values. A ConfigSnapshot returned in Studio contains only the testing values set with SetTestingValue().
* Testing values set with SetTestingValue() persist only for the current session and do not change the actual stored config values.

## Properties

## Methods

### ClearTestingValue

Removes a testing value set with SetTestingValue().

When a testing value is removed, the original config value is prepared for any ConfigSnapshot that has already been returned, so its Outdated becomes true and the UpdateAvailable event fires. The value is actually applied only after you call Refresh(). If no testing value is set for the key, this method does nothing.

#### Parameters

| `Value` Key | <p>The key of the config value whose testing value to remove.</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

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

#### Code Samples

### GetConfigAsync

Loads the world's common config values and returns them as a ConfigSnapshot.

This method yields the calling script until the config values are loaded. If the world session information is not ready yet or the config lookup fails, an error is raised, so wrapping calls in pcall is recommended.

While the returned ConfigSnapshot exists, it periodically checks whether a new version of the config values is available.

#### Parameters

#### Return

| `ConfigSnapshot` | A ConfigSnapshot that holds the world's common config values at the time of the call. |
| ---------------- | ------------------------------------------------------------------------------------- |

#### Code Samples

### GetConfigForPlayerAsync

Loads the config values evaluated for the specified player and returns them as a ConfigSnapshot.

Unlike GetConfigAsync(), this method looks up the config values that apply to the player again on every call. It yields the calling script until the config values are loaded, and if the lookup fails, an error is raised, so wrapping calls in pcall is recommended.

#### Parameters

| `Value` Player | <p>The Player to look up config values for.</p><ul><li>An error is raised if the value is not a Player in the current world or is a Player without valid account information.</li></ul> |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

#### Return

| `ConfigSnapshot` | A ConfigSnapshot that holds the config values evaluated for the player at the time of the call. |
| ---------------- | ----------------------------------------------------------------------------------------------- |

#### Code Samples

### SetTestingValue

Sets a config value for a specific key for testing purposes.

The testing value takes precedence over the loaded config values and is reflected immediately in any ConfigSnapshot returned afterward by GetConfigAsync() or GetConfigForPlayerAsync(). For a ConfigSnapshot that has already been returned, the new value is prepared, its Outdated becomes true, and the UpdateAvailable event fires; the value is actually applied only after you call Refresh().

Testing values persist only for the current session and do not change the actual stored config values. Setting the same value as the existing testing value does nothing.

#### Parameters

| `Value` Key   | <p>The key of the config value to set a testing value for.</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>                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Value` Value | <p>The testing value to set.</p><ul><li>You can pass a string, boolean, number, or table. A table must have string keys, and arrays can only be used inside a table.</li><li>Passing a value of an unsupported type, such as nil, a function, or an Instance, raises an error. To remove a testing value, use ClearTestingValue().</li><li>NaN, infinity, and integers whose absolute value exceeds 2^53 cannot be used.</li><li>Tables with circular references, tables that mix string keys and numeric indices, arrays with gaps, and strings that are not valid UTF-8 cannot be used.</li><li>An error is raised if the size of the value converted to JSON exceeds 100,000 characters in UTF-16.</li></ul> |

#### Return

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

#### Code Samples

## Events
