Frontend API overview
The Frontend API is designed for frontend SDKs running in browsers, mobile apps, and other client-side environments. Unlike the Client API, it only returns enabled feature flags for a specific Unleash Context, providing security and performance benefits.
Base path: <your-unleash-url>/api/frontend
Primary use: Fetch enabled flags for a specific user context without exposing your entire flag configuration. Frontend SDKs handle registration, polling, and metrics automatically.
Key differences from Client API
Authentication
Use frontend tokens for authentication. These tokens can be scoped to specific projects and environments and are safe to embed in client-side code.
To create a frontend token, go to Admin settings > Access control > API access > New API token.
Available endpoints
Unleash Context
Each request requires an Unleash Context to evaluate flags. For example, include fields like userId, sessionId, and custom properties for targeting:
Learn more about context fields and constraints.
Using with Unleash Edge
For production applications, use Unleash Edge to improve performance, privacy, and reduce latency. Edge caches evaluations closer to your users and provides built-in fallback mechanisms.
Point your SDK to your Edge instance instead of directly to Unleash: