Integrating FlagPal into Your Application¶
Once you've created a project and API token, you're ready to connect FlagPal to your codebase. There are two ways to do it: through the API directly, or with one of our SDKs.
High-Performance Architecture: Caching & Webhooks¶
For mission-critical production environments where request latency and uptime are paramount, querying the API over the network for every user evaluation is inefficient.
The recommended integration architecture pairs local caching with real-time webhooks:
- Local Evaluation: Your application or SDK fetches all feature flags, experiences, and experiments at startup and caches them in fast in-memory storage (e.g. Redis, Memcached, APCu, or local process memory). Flag resolution happens locally with sub-millisecond execution times and zero network overhead.
- Instant Webhook Synchronization: You configure a Webhook in FlagPal. Whenever any flag, experience, or experiment is created, updated, or deleted, FlagPal dispatches an HMAC-signed event to your application, which immediately invalidates or refreshes the local cache.
Learn how to set up Webhooks & Cache Synchronization →
Direct API Integration¶
Every request to FlagPal — fetching feature flags, recording metrics, managing actors — goes through our API, authenticated with your API token as a bearer token. It's a universal approach: any language or framework that can make an HTTP request can integrate with FlagPal directly.
See the full API Reference for every available endpoint.
SDKs & Clients¶
If you'd rather not talk to the API directly, we maintain official SDKs that handle authentication, caching, and idiomatic usage for you:
| Client | Language / Framework | Link |
|---|---|---|
| FlagPal for Laravel | PHP (Laravel) | GitHub |
More SDKs on the Way 🎉
We're actively building out SDKs for more languages and frameworks, so keep an eye out! If yours isn't covered yet, the direct API integration will always be there for you in the meantime, and it's a great option in its own right.