js-sdks
js-sdks copied to clipboard
feat: wrap vercel flags
- create a helper in Next SDK that wraps the Vercel "flag" function to make it "feature /variation" aware
- when you call the returned wrapped function with a variable key and default value, it figures out from the main config which feature that variable belongs to. It then calls the Vercel "flag" function using the feature as the "key" and obtaining a variation id for that feature
- it also provides "options" for the toolbar which are the list of variations in the feature
- this allows someone using the toolbar to select an override for a feature and its variation, which is then used to alter the values of all the variables in that feature, but the code can continue to use variable keys for evaluation