You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,16 @@ pip install -e .
42
42
```python
43
43
import asyncio
44
44
from extend import ExtendClient
45
+
from extend.auth import BasicAuth
45
46
46
47
47
48
asyncdefmain():
48
49
# Initialize the client
49
50
client = ExtendClient(
50
-
api_key="your-api-key",
51
-
api_secret="your-api-secret"
51
+
auth=BasicAuth(
52
+
"your-api-key",
53
+
"your-api-secret",
54
+
)
52
55
)
53
56
54
57
# Get all virtual cards
@@ -64,6 +67,27 @@ async def main():
64
67
asyncio.run(main())
65
68
```
66
69
70
+
### Using Custom Authorization
71
+
72
+
Both `ExtendClient` and `APIClient` accept reusable authorization strategies defined in `extend.auth`, enabling scenarios like JWT-based access or shared credentials across clients.
73
+
74
+
```python
75
+
from extend import ExtendClient
76
+
from extend.auth import BearerAuth
77
+
78
+
auth = BearerAuth(jwt_token="your-jwt-token")
79
+
client = ExtendClient(auth=auth)
80
+
```
81
+
82
+
If you want to work with the lower-level `APIClient` directly, you can pass any `Authorization` implementation:
0 commit comments