Hello there! I'm wondering if there is a way to mo...
# ask-questions
a
Hello there! I'm wondering if there is a way to mock growthbook or force default values for features in local dev environments rather than hitting a real growthbook api. Is that possible ?
f
yes, possible
you can use the Chrome extension, thats the easiest
a
How would that work with the Ruby SDK for example ?
f
oh
b
right now i think the only backend SDK that supports overriding feature values without code changes is the java SDK, using
.url(theUrlOfThePage)
and
.allowUrlOverrides(true)
(this boolean can be enabled maybe based on environment, e.g. false in prod, true in staging/qa/dev to prevent real users from forcing feature values) https://docs.growthbook.io/lib/java#force-feature-values-via-the-url – it requires adding query params to your URL and then the backend SDK will need to pass the URL to the SDK. you can see an example implementation here. right now this functionality isn't in the ruby SDK. we had started supporting the URI encoding in the chrome extension to make this a bit nicer but this approach was deprioritized, but for now, if you use the java SDK, you'd need to URI encode the URL yourself since we hadn't built out the tooling to do so. take a look at the above-linked example and docs and let us know if you think this is something that would work and maybe the team can discuss whether it's worth adding to ruby and other SDK's.
145 Views