You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During initialization, the SDK sends an API request to a CDN to retrieve the most recent experiment configurations from Eppo,
30
38
such as variation values and traffic allocation. The SDK stores these configurations in memory so that assignments are effectively instant.
31
39
For more information, see the [architecture overview](/sdks/architecture) page.
32
40
33
41
This SDK also leverages cached configurations from previous fetches. During initialization, if a previously-cached configuration
34
42
is successfully loaded, it will complete initialization with that configuration. Updates will take effect once the fetch from CDN completes.
35
-
When initialization completes from either source, it will call the optionally-provided `InitializationCallback`.
43
+
44
+
The initialization methods, `buildAndInit` and `buildAndInitAsync` return or resolve to an `EppoClient` instance with a loaded configuration.
45
+
46
+
### Initial Configuration
47
+
48
+
You can pass an initial configuration payload (of type `byte[]`) to the `EppoClient.Builder` class. This prevents the `EppoClient` from loading its initial configuration from a cached source, but **does not prevent an initial fetch**. You must use `offlineMode` to prevent fetching upon initialization.
49
+
50
+
```java
51
+
// Example app configuration payload
52
+
interfaceMyAppConfig {
53
+
StringgetEppoConfig();
54
+
}
55
+
56
+
// Initialize the Eppo Client with the async result of the initial client configuration.
Using `offlineMode` mode prevents the `EppoClient` from sending an API request upon initialization. When set to `true`, the `EppoClient` will attempt to load configuration from a cache on the device, or an `initialConfiguration`, if provided. The latest configuration can be pulled from the API server at any time using the `EppoClient.loadConfiguration` and `EppoClient.loadConfigurationAsync` methods.
If you are using the SDK for experiment assignments, make sure to pass in an assignment logging callback (see [section](#define-an-assignment-logger-experiment-assignment-only) below).
38
95
@@ -59,31 +116,18 @@ AssignmentLogger assignmentLogger = new AssignmentLogger() {
0 commit comments