Roblox UtilitiesDevlHub Roblox Documentation

Class

ConfigService

NotCreatableServiceNotReplicated
Inherits
Instance › Object
Memory category
Instances

A game service that gives access to in-experience configuration with updates in real time.

ConfigService exposes methods for getting ConfigSnapshot objects. Configs can only be accessed by game servers, so you can't use ConfigService within client scripts.

See Experience configs for an in-depth guide on managing keys, deploying real-time updates, error handling, limits, and more.

Methods 4#

ClearTestingValueClears current testing value for the given key.
GetConfigAsyncRetrieves a snapshot of the latest configuration.Yields
GetConfigForPlayerAsyncRetrieves a snapshot of the latest configuration for a specific player.Yields
SetTestingValueSets a testing override for the given key.

ClearTestingValue(key: string): ()#

Removes a testing override created by the SetTestingValue() function. The actual configured value will be returned after calling this function.

NameTypeDefaultDescription
keystringKey of the configuration to clear testing value for.
Returns
  • ()

GetConfigAsync(): ConfigSnapshot#

Yields

This function retrieves the latest available configuration as a ConfigSnapshot instance without player targeting. Snapshots can be refreshed to the latest values by calling ConfigSnapshot:Refresh().

Experiments are not applied since there is no player context.

If configuration fails to load and there is no previously available configuration, this function throws an error.

Returns

GetConfigForPlayerAsync(player: Player): ConfigSnapshot#

Yields

Retrieves the latest available configuration as a ConfigSnapshot instance targeting to the given player. Snapshots can be refreshed to the latest values by calling ConfigSnapshot:Refresh().

This function applies all experiments running for the player.

If configuration fails to load and there is no previously available configuration, this function throws an error.

NameTypeDefaultDescription
playerPlayerThe player to get the configuration for.
Returns

SetTestingValue(key: string, value: Variant): ()#

Sets a testing override for the specified configuration key in the current server instance. When a testing value is set, calls to ConfigSnapshot:GetValue() for that key will return the testing value instead of the actual configured value.

Testing values can be cleared by calling the ClearTestingValue() function.

NameTypeDefaultDescription
keystringKey of the configuration to override with a testing value.
valueVariantValue to set as the testing override.
Returns
  • ()

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed