Guides integration of the FeatBit Python Server-Side SDK for backend services. Use when users ask about FeatBit feature flags in Python, fbclient usage, or server frameworks like Flask, Django, or FastAPI. Not for client-side use.
View on GitHubFebruary 3, 2026
Select agents to install to:
npx add-skill https://github.com/featbit/featbit-skills/blob/main/skills/featbit-python-sdk/SKILL.md -a claude-code --skill featbit-python-sdkInstallation paths:
.claude/skills/featbit-python-sdk/# FeatBit Python Server-Side SDK Expert guidance for integrating the FeatBit Python Server-Side SDK in backend applications. This skill is based on the official SDK README and keeps details in reference files for quick navigation. ## Activates When - The user asks about FeatBit Python SDK setup, usage, or troubleshooting. - The user mentions `fbclient`, `FBClient`, `variation`, `variation_detail`, or `flag_tracker`. - The user needs server-side feature flag evaluation in Python (Flask, Django, FastAPI, etc.). ## Overview Use this SDK to evaluate feature flags on the server. The SDK syncs flag data via websocket and stores it in memory by default. If you need a custom data source, use offline mode with bootstrap JSON. ## Core Knowledge Areas ### 1. Data Synchronization - Websocket sync keeps local data updated (average sync < 100 ms). - The connection can be interrupted but resumes automatically after outages. - Offline mode disables remote sync; use bootstrap JSON if needed. ### 2. Installation and Prerequisites - Install: `pip install fb-python-sdk` (Python 3.6–3.11). - Required values: `env_secret`, `event_url`, `streaming_url`. - Official FAQ: environment secret + SDK URLs. ### 3. Initialization and Client Lifecycle - Preferred pattern: call `set_config(...)`, then `get()` for a singleton client. - Direct instantiation: `FBClient(Config(...), start_wait=15)`. - Async readiness: `client.update_status_provider.wait_for_OKState()`. ### 4. Evaluation and All Flags - Evaluate: `variation()` for value, `variation_detail()` for value + reason. - All flags: `get_all_latest_flag_variations(user)`. - Defaults are returned when SDK is not initialized or keys are invalid. ### 5. User Model - Use a dict with required `key` and `name`. - Add custom properties (string, number, boolean). ### 6. Flag Change Tracking - `flag_tracker.add_flag_value_maybe_changed_listener(...)`. - `flag_tracker.add_flag_value_changed_listener(...)`. ### 7. Offline Mode and Bootstr