-
Notifications
You must be signed in to change notification settings - Fork 2
Offline Init Part 3 of 4: Add offlineInit() for synchronous SDK initialization without network #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
aarsilv
merged 5 commits into
main
from
aarsilv/ffesupport-461-offline-init-part3-offline-init
Jan 27, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0121c3c
Add offlineInit() for synchronous SDK initialization without network
aarsilv 0b5c5eb
Add getBanditAction verification to offlineInit bandit test
aarsilv 44be8c2
Refactor offlineInit tests for clarity
aarsilv 49e3f9c
Add validation for offlineInit() configuration
aarsilv 6111973
Move validation functions after offlineInit, fix error logging
aarsilv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,10 @@ export interface IClientConfig { | |
| /** Amount of time in milliseconds to wait between API calls to refresh configuration data. Default of 30_000 (30s). */ | ||
| pollingIntervalMs?: number; | ||
|
|
||
| /** Configuration settings for the event dispatcher */ | ||
| /** | ||
| * Configuration settings for the event dispatcher. | ||
| * @deprecated Eppo has discontinued eventing support. Event tracking will be handled by Datadog SDKs. | ||
| */ | ||
| eventTracking?: { | ||
| /** Maximum number of events to send per delivery request. Defaults to 1000 events. */ | ||
| batchSize?: number; | ||
|
|
@@ -74,3 +77,55 @@ export interface IClientConfig { | |
| retryIntervalMs?: number; | ||
| }; | ||
| } | ||
|
|
||
| /** | ||
| * Configuration used for offline initialization of the Eppo client. | ||
| * Offline initialization allows the SDK to be used without making any network requests. | ||
| * @public | ||
| */ | ||
| export interface IOfflineClientConfig { | ||
| /** | ||
| * The full flags configuration JSON string as returned by the Eppo API. | ||
| * This should be the complete response from the /flag-config/v1/config endpoint. | ||
| * | ||
| * Expected format: | ||
| * ```json | ||
| * { | ||
| * "createdAt": "2024-04-17T19:40:53.716Z", | ||
| * "format": "SERVER", | ||
| * "environment": { "name": "production" }, | ||
| * "flags": { ... } | ||
| * } | ||
| * ``` | ||
| */ | ||
| flagsConfiguration: string; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opted to deviate from our client JS SDK and follow in the footsteps of python and iOS using the more user-friendly and information-rich wire format. |
||
|
|
||
| /** | ||
| * Optional bandit models configuration JSON string as returned by the Eppo API. | ||
| * This should be the complete response from the bandit parameters endpoint. | ||
| * | ||
| * Expected format: | ||
| * ```json | ||
| * { | ||
| * "updatedAt": "2024-04-17T19:40:53.716Z", | ||
| * "bandits": { ... } | ||
| * } | ||
| * ``` | ||
| */ | ||
| banditsConfiguration?: string; | ||
|
|
||
| /** | ||
| * Optional assignment logger for sending variation assignments to your data warehouse. | ||
| * Required for experiment analysis. | ||
| */ | ||
| assignmentLogger?: IAssignmentLogger; | ||
|
|
||
| /** Optional bandit logger for sending bandit actions to your data warehouse */ | ||
| banditLogger?: IBanditLogger; | ||
|
|
||
| /** | ||
| * Whether to throw an error if initialization fails. (default: true) | ||
| * If false, the client will be initialized with an empty configuration. | ||
| */ | ||
| throwOnFailedInitialization?: boolean; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May as well start flagging this as deprecated so we can rip out in a future version! 🪓