Skip to content

Accessing Configurations

Initialize before access

Always call Initialize() before reading any configuration values. This loads the bundled fallback configuration into memory so GetConfiguration<T>() works even before the first sync:

var configurations = playOpsSDK.Configurations();
configurations.Initialize();

GetConfiguration

var iapConfig = configurations.GetConfiguration<IAPConfig>();
foreach (var product in iapConfig.InAppProducts)
{
Debug.Log($"{product.Title}: ${product.Price}");
}

GetConfiguration<T>() returns the cached instance of T. The first call returns the bundled default. After a successful Sync(), it returns the downloaded values.

Reset

Clears the in-memory cache and removes the locally persisted configuration. The next call to GetConfiguration<T>() after Initialize() will again return the bundled default:

configurations.Reset();
configurations.Initialize();

Useful in testing or when you want to force a clean state.

GetMetadataVersion

Returns the version metadata of the currently active configuration:

var version = configurations.GetMetadataVersion();
Debug.Log($"Config version: {version.Version}, environment: {version.Environment}");

This is useful for debugging — you can log the version on session start to verify which configuration a player is running.