Full Stack SDKs open a well-defined set of public APIs, hiding all implementation details. However, some clients may need access to project configuration data within the [Manage config (datafile)](🔗).
In this document, we extend our public APIs to define data models and access methods, which clients can use to access project configuration data.
## OptimizelyConfig API
A public configuration data model (OptimizelyConfig) is defined below as a structured format of static Optimizely Project data.
### Get OptimizelyConfig
OptimizelyConfig can be accessed from OptimizelyClient (top-level) with this public API call:
getOptimizelyConfig` returns an `
OptimizelyConfig` instance which includes
the datafile revision number
all experiments mapped by their key values
feature flags mapped by their key values
function to retrieve the project configuration (the datafile)
When the SDK datafile is updated (the client can add a notification listener for `
ProjectConfigUpdateNotification` to get notified), the client is expected to call the method to get the updated OptimizelyConfig data. See examples below.
### Get datafile
To share the same datafile between multiple SDK instances (for example, in a client/server scenario), you can pass a JSON string representation of the config (the datafile) between the instances. To get the datafile, use the `
OptimizelyConfig` object's `
GetDatafile` method. For more information, see [Multiple SDK implementations, sharing the datafile with client SDKs](🔗).
### Object model
The following shows the object model for OptimizelyConfig.
OptimizelyConfig can be accessed from OptimizelyClient (top-level) like this: