diff --git a/README.md b/README.md index 290d990..2bc3912 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,33 @@ event = client.verify_and_parse_webhook(raw_body, headers, "webhook_secret") ``` +### User avatar + +After fetching the user, avatar data is available through the `AuthenticatedUser` object: + +```python +user = client.fetch_user(token_set.access_token) + +# Direct avatar URL (or None if not set) +print(user.avatar_url) + +# Size variants: small, medium, large, xlarge +for variant, url in user.avatar_variants.items(): + print(f"{variant}: {url}") +``` + +The `avatar_url` and `avatar_variants` are read from the `profile` section of the `/oauth/userinfo` response. Avatar URLs are public — no additional token is required to download the image. + +If you need the raw binary data of an avatar, use any HTTP client: + +```python +import httpx + +if user.avatar_url: + response = httpx.get(user.avatar_url) + image_bytes = response.content +``` + See `examples/plain/example.py` for a more complete demonstration. ## Package Structure