title |
---|
Frontend API |
:::note Availability
Version: 4.18+
:::
The Unleash Frontend API simplifies connecting client-side applications to Unleash. Unleash Edge also implements this API allowing you to scale from development environments, low-traffic applications, or internal dashboards to a production-ready scalable solution.
The Frontend API has a straightforward setup, and since it is built directly into Unleash, you don't need to manage it. However, unlike Unleash Edge, it cannot be scaled horizontally and isn’t designed for high request volumes.
Since the Frontend API shares the same API as Unleash Edge, you can start development with the Frontend API and transition to Unleash Edge when needed.
For web and hybrid mobile apps, allow traffic from your application's domains. To update CORS settings in the Unleash Admin UI, go to Admin > CORS origins. Alternatively, you can update CORS using the Admin API.
Point your application to the correct API endpoint: <your-unleash-instance>/api/frontend
.
Your application needs a frontend token to interact with the Frontend API.
Feature flag updates occur at a default refresh interval of 10 seconds plus a random offset (0-10 seconds) to prevent simultaneous database queries. You can customize the refresh interval using the FRONTEND_API_REFRESH_INTERVAL_MS
environment variable or the frontendApi.refreshIntervalInMs
configuration option in the SDK.