tryabby / abby

Open-Source Feature Flags, Remote Config & A/B Tests for Developers ⛳🧪
https://www.tryabby.com
GNU Affero General Public License v3.0
143 stars 19 forks source link

How to get all featureflags with tryabby/next outside of a react scope #109

Closed mdilg closed 2 months ago

mdilg commented 8 months ago

If i got it right with tryabby/next 5.1.0 useFeatureFlags was introduced. But is there an equivalent to use outside of a react context. Like getFeatureFlagValue is one for useFeatureFlag?

cstrnt commented 7 months ago

The createAbby function exposes the __abbby__ class which has the getFeatureFlags method. This can be used to read all feature flags outside of the react context. It's important to call await loadProjectData() beforehand tough to receive the newest data from the Abby API. Otherwise it will use the fallbacks.