Skip to main content
Glama
reflagcom

Bucket Feature Flags MCP Server

Official
by reflagcom
ReflagBootstrappedProvider.vue1.39 kB
<script setup lang="ts"> import { onMounted, provide, ref, watch } from "vue"; import { ProviderSymbol, useOnEvent, useReflagClient } from "./hooks"; import type { ReflagBootstrappedProps } from "./types"; const { flags, initialLoading = false, enableTracking = true, debug, ...config } = defineProps<ReflagBootstrappedProps>(); const client = useReflagClient( { ...config, ...flags?.context, enableTracking, bootstrappedFlags: flags?.flags, }, debug, ); const isLoading = ref( client.getState() !== "initialized" ? initialLoading : false, ); useOnEvent( "stateUpdated", (state) => { isLoading.value = state === "initializing"; }, client, ); // Initialize the client if it is not already initialized onMounted(() => { if (client.getState() !== "idle") return; void client.initialize().catch((e) => { client.logger.error("failed to initialize client", e); }); }); // Update the context if it changes watch( () => flags.context, (newContext) => { void client.setContext(newContext); }, { deep: true }, ); // Update the flags if they change watch( () => flags.flags, (newFlags) => { client.updateFlags(newFlags); }, { deep: true }, ); provide(ProviderSymbol, { isLoading, client, }); </script> <template> <slot v-if="isLoading && $slots.loading" name="loading" /> <slot v-else /> </template>

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/reflagcom/bucket-javascript-sdk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server