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: docs/sdks/sdk-ref-python.md
+163-7Lines changed: 163 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ Decryption response codes, and their meanings, are shown in the following table.
145
145
2. Call a function that takes the user's email address or phone number as input and generates a `TokenGenerateResponse` object. The following example uses an email address:
3. Periodically check if the user's UID2 token should be refreshed. This can be done at fixed intervals using a timer, or can be done whenever the user accesses another page:
188
188
1. Retrieve the identity JSON string from the user's session, and then call the following function that takes the identity information as input and generates an `IdentityTokens` object:
189
189
@@ -194,20 +194,21 @@ If you're using server-side integration (see [Publisher Integration Guide, Serve
194
194
2. Determine if the identity can be refreshed (that is, the refresh token hasn't expired):
195
195
196
196
```py
197
-
ifnot identity ornot identity.is_refreshable(): # we must no longer use this identity (for example, remove this identity from the user's session)
197
+
ifnot identity ornot identity.is_refreshable():
198
+
# we must no longer use this identity (for example, remove this identity from the user's session)
198
199
```
199
200
200
201
3. Determine if a refresh is needed:
201
202
202
203
```py
203
-
if identity.is_due_for_refresh()):
204
+
if identity.is_due_for_refresh():
204
205
```
205
206
206
207
4. If needed, refresh the token and associated values:
reason= unmapped_identity.reason # OPTOUT, INVALID_IDENTIFIER, or UNKNOWN
264
+
```
265
+
266
+
>**Note:** The SDK automatically handles email normalization and hashing, ensuring that raw email addresses and phone numbers do not leave your server.
# Alternatively you can get reason as a string, values match the old ones
369
+
raw_reason= unmapped.raw_reason
370
+
```
371
+
372
+
## Previous Version (V2 Identity Map)
373
+
374
+
:::note
375
+
The V2 Identity Map SDKis an older version maintained for backwards compatibility. Migrate to the current SDKfor improved performance, multi-identity type support, and better UID rotation management.
376
+
New integrations should not use this version.
377
+
See [Migration From Older Identity Map Version](#migration-from-older-identity-map-version) for instructions.
378
+
:::
379
+
224
380
To map email addresses, phone numbers, or their respective hashes to their raw UID2s and salt bucket IDs, follow these steps.
225
381
226
382
1. Create an instance of `IdentityMapClient`as an instance variable.
0 commit comments