Server
API Route
Internal API endpoint for client-side flag updates.
The module registers an internal API route that the client plugin uses for polling.
Endpoint
GET /api/_unleash/flags
Response
{
"toggles": {
"my-flag": {
"name": "my-flag",
"enabled": true,
"variant": {
"name": "default",
"enabled": false
}
}
},
"lastUpdated": 1712436000000,
"ready": true
}
Behavior
- Reads flags from the configured storage backend
- Applies stale-while-revalidate: if the cache is stale, triggers a background refresh but returns current data immediately
- The Unleash Proxy token is never exposed — the server fetches from the proxy, the client fetches from this route
You typically don't need to call this endpoint directly. The client plugin handles polling automatically.
This endpoint is publicly accessible without authentication and exposes the names and states of all feature flags. If this is a concern, consider using Nuxt server middleware to restrict access.