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
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,121 @@ You can also use the [Python starter kit here](https://github.com/kinde-starter-
10
10
11
11
For details on integrating this SDK into your project, head over to the [Kinde docs](https://kinde.com/docs/) and see the [Python SDK](https://kinde.com/docs/developer-tools/python-sdk/) doc 👍🏼.
12
12
13
+
## Storage Usage Examples
14
+
15
+
### Basic Usage
16
+
```python
17
+
from kinde_sdk.auth import OAuth
18
+
from kinde_sdk.core.storage import StorageManager
19
+
20
+
# Basic initialization via OAuth
21
+
# This is the recommended way to initialize the storage system
22
+
# OAuth automatically initializes the StorageManager with the provided config
3.**Safe access pattern**: If you're unsure about initialization status, you can use this pattern:
106
+
```python
107
+
storage_manager = StorageManager()
108
+
ifnot storage_manager._initialized:
109
+
storage_manager.initialize()
110
+
111
+
# Now safe to use
112
+
data = storage_manager.get("some_key")
113
+
```
114
+
115
+
4.**Single configuration**: Configure the storage only once at application startup. Changing storage configuration mid-operation may lead to data inconsistency.
116
+
117
+
5.**Access from anywhere**: After initialization, you can safely access the StorageManager from any part of your application without passing it around.
118
+
119
+
6.**Device-specific data**: Understand that by default, data is stored with device-specific namespacing. To share data across devices, use the appropriate prefixes.
120
+
121
+
7.**Complete logout**: To ensure all device-specific data is cleared during logout, call `storage_manager.clear_device_data()`.
122
+
123
+
124
+
125
+
# After initializing both OAuth and KindeApiClient use the following fn to get proper urls
0 commit comments