Client side evaluation with initial read from file system

Hello,

I am looking for an option to allow to fallback to initially load the state from file system when using client side sdk (java and react in my case). The use case for it is that the system can be installed in environments where flipt is available and in some that it won’t have access to flipt. The idea is to have an option to fallback to load the state from file - last known from git at build time.

Was looking into the docs and couldn’t find a way to do so, it seems it is always reaching out to a url. If there is no way to load it from file system what would it take to fake the flipt url to just return the state?

thanks
Maciej

Hey @mswiderski

This option is not currently available. However, I believe it could be possible to have an additional option that allows the client to receive a string or byte array representing the initial fallback state. That said, accessing the file system may not be feasible across all environments (e.g., browsers, cloud functions), which could pose compatibility issues. Let’s see what @mark thinks about it.

1 Like

yeah, file system is certainly not a strict requirement as long as it can be string or bytes that would work out nicely.

Hey @mswiderski

We just got a similar request today in our client sdk repo: Dart/Flutter support for iOS/Android · Issue #945 · flipt-io/flipt-client-sdks · GitHub

I think this makes a lot of sense, we can expose the ability to seed the clients on startup as well as expose a method to get the latest state so you can save it in your app intermittently.

Would this work?

That would be excellent and fulfill all the needs we see at the moment. Thanks a lot for considering it.

Cheers. I will create an issue in our client side SDKs repo and get working on it ASAP

Thank you again!

For tracking: Support Seeding Client SDKs with Serialized Flag State · Issue #970 · flipt-io/flipt-client-sdks · GitHub