Flags ready: {{ ready }}
Flag count: {{ flagCount }}
{{ JSON.stringify(allFlags, null, 2) }}
```
```
--------------------------------
### Configure Upstash Redis for Nitro Storage
Source: https://github.com/adamkasper/nuxt-unleash/blob/main/docs/content/docs/2.storage/3.nitro.md
Configure Nitro's storage to use the Upstash Redis driver. This requires the Redis URL and token, typically sourced from environment variables.
```typescript
nitro: {
storage: {
unleash: {
driver: 'upstash',
url: process.env.UPSTASH_REDIS_REST_URL,
token: process.env.UPSTASH_REDIS_REST_TOKEN,
},
},
}
```
--------------------------------
### Add nuxt-unleash to Nuxt configuration
Source: https://github.com/adamkasper/nuxt-unleash/blob/main/docs/content/docs/1.getting-started/1.installation.md
Configure the nuxt-unleash module in your nuxt.config.ts file. Ensure the `url` points to your Unleash Proxy's Frontend API endpoint.
```typescript
export default defineNuxtConfig({
modules: ['@adamkasper/nuxt-unleash'],
unleash: {
url: 'https://your-unleash-proxy.example.com/api/frontend',
token: 'your-frontend-api-token',
appName: 'my-app',
},
})
```
--------------------------------
### Check Flag Loading Status in Vue
Source: https://github.com/adamkasper/nuxt-unleash/blob/main/README.md
Use the `useFlagsStatus` composable to monitor the loading state of feature flags. It returns an object containing `ready` status and `flagCount`.
```vue
{{ JSON.stringify(allFlags, null, 2) }}
```
--------------------------------
### useVariant
Source: https://github.com/adamkasper/nuxt-unleash/blob/main/docs/content/docs/3.composables/2.use-variant.md
Retrieves the variant of a feature flag. This is useful for implementing A/B tests or serving different content based on feature flag variants.
```APIDOC
## useVariant
### Description
Retrieves the variant of a feature flag. This is useful for implementing A/B tests or serving different content based on feature flag variants.
### Signature
```typescript
function useVariant(name: string): ComputedRef