This example demonstrates the basic usage of the Replane Python SDK with the asynchronous client.
- Python 3.10 or higher
- A running Replane server
- An SDK key from your Replane dashboard
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Update configuration in
main.py:
BASE_URL = "https://your-replane-server.com"
SDK_KEY = "your_sdk_key_here"python main.py- Using the
AsyncReplanewith async context manager - Reading feature flags and configs (sync read from local cache)
- Passing context for override evaluation
- Using default values for missing configs
- Manual async client lifecycle
- Subscribing to config changes (sync and async callbacks)
- Real-time config updates
The get() method is intentionally synchronous even in the async client because it only reads from the local in-memory cache. There's no I/O involved, so there's no benefit to making it async. The SSE connection that keeps the cache updated runs in a background task.