nuxt-flagsmith
Version:
Nuxt.js module to use Flagsmith toggle feature services
16 lines (11 loc) • 336 B
text/typescript
import FlagsmithFlags from "./FlagsmithFlags";
function plugin(ctx, inject) {
const FEATURES = JSON.parse('<%= options.data %>');
const flagsmithFlags = FlagsmithFlags.create({
features: FEATURES,
});
inject("flagsmith", flagsmithFlags);
ctx.app.flagsmith = flagsmithFlags;
}
export { plugin };
export default plugin;