statsig-io / statsig-feedback

Issue Tracker for Statsig. Leave your feedback on anything we do!
5 stars 0 forks source link

Getting updated gate configuration #7

Closed matthewtole closed 2 years ago

matthewtole commented 3 years ago

Do the React client SDK and the Node.js server SDK have real-time updating of gate configuration?

From reading the docs and the code my understanding is that the gate configuration data is only fetched when the SDK is initialized. For a single-page React application, that will only happen when they first visit the app, and won't happen again until they refresh the page or open a new tab.

Is there a recommendation for keeping the configuration updated, so that we can turn off a feature in the console and know with some level of certainty that the changes will be applied within a few minutes?

marcos-statsig commented 3 years ago

The Node.js server SDK will refresh the latest configuration every 10 seconds.

For the React and JS client SDKs, right now it doesn't pull the latest configuration while on the page. We will provide an option when initializing the SDK to enable auto-refresh for those SDKs soon.

We'd be interested to hear what your use case for having the real-time updating in React and how urgent this is for you. We didn't prioritize this initially as we felt it might result in weird user-experiences if the UI could change, potentially drastically, in real-time.

marcos-statsig commented 2 years ago

We've added this functionality to most client SDKs, but not Javascript or React yet given the potential weird behaviors with gates changing during a client's session. Please feel free to reopen this if this is still something needed by your team.