Repository navigation
feat!: reject unsupported remoteEval configurations and add setUrl - #189
Open
vazarkevych wants to merge 1 commit into
Open
vazarkevych wants to merge 1 commit into
vazarkevych wants to merge 1 commit into
Conversation
BREAKING CHANGE: initialize() throws ArgumentError for a remoteEval configuration with an empty apiKey, an encryptionKey, or a GrowthBook Cloud host.
This was referenced Oct 20, 2026
Open
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Validates the remote-evaluation configuration at startup and adds
setUrl. Supersedes #173 and section 3 of #176, which disagreed on the rules; this follows the JS SDK.Validation rules
initialize()throws anArgumentErrorfor the remote-eval configurations theGrowthBookconstructor in the JS SDK rejects, and only those:remoteEval: trueapiKeyMissing clientKeyencryptionKeysetEncryption is not available for remoteEvalgrowthbook.io(subdomains included)Cannot use remoteEval on GrowthBook CloudstickyBucketServicesetbackgroundSync: trueHow this resolves the open questions from #173:
features-updatedevent is handled. This was verified against a GrowthBook Proxy.hostname.match(/growthbook\.io$/i)). A URL that only contains the string elsewhere, e.g.growthbook.io.example.comor a path segment, is accepted.setUrl
setUrl(String url)sets the URL used for URL targeting, likesetURLin the JS SDK. If the URL is unchanged it does nothing; in remote-eval mode the returned Future completes after the fresh evaluation.The remote-eval payload now carries
url(""when unset, as in the JS SDK). Neither #173 nor #176 sent it, so asetUrlrefetch would not have reached URL-targeting rules on the server.Breaking change
An app that starts with one of the rejected configurations, and silently got no working remote evaluation, now fails at startup. Release target: 5.0.0.
Test plan
remote_eval_test.dart(13 tests):remoteEval;urlin the payload (unset and configured);setUrlwith and without remote evaluation, and an unchanged URL.urlis dropped from the payload, or the unchanged-URL check is removed.gb_sdk_remote_eval_test.dartnow uses a self-hosted test host, sinceexample.growthbook.iois rejected.dart analyze --fatal-infos,dart formatandflutter test(3 runs) clean.