diff --git a/README.md b/README.md index 9ff27c6..2315233 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,18 @@ from reflag import Client with Client() as client: flags = client.bind({"user": {"id": "user-123"}, "company": {"id": "company-123"}}) - enabled = flags.get_flag("my-flag", default=False) + enabled = flags.get_flag("my-flag") settings = flags.get_flag("settings", default={"theme": "light"}) ``` -Replace the flag keys and IDs with your own. Reuse one client per application worker; -initialization loads definitions, and subsequent flag reads are local and in-memory. +Omitting `default` is equivalent to `default=False` and returns a `bool`. + +Replace the flag keys and IDs with your own. + +Create and initialize **one client per application worker** at startup, reuse it +across requests, and close it at shutdown. Do not create a new client for each request +or flag check. Use `client.bind(...)` for request-specific user/company context. +Initialization loads definitions; subsequent flag reads are local and in-memory. For async applications, use `async with AsyncClient()` in the application lifespan. Flag reads remain synchronous: do **not** await `get_flag()`.