Skip to content

Commit 433a286

Browse files
authored
Update user-identity.mdx
1 parent f15a885 commit 433a286

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

fern/docs/pages/plug-sdk/web/user-identity.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -126,35 +126,35 @@ const sessionToken = '<SESSION_TOKEN>'
126126
You can also pass the identifiers in the `plugSDK.init` option without generating the session token.
127127

128128
<Callout intent="note">
129-
The frontend method, by its nature, is not secure as the data is transmitted through the client side. We recommend using the session token method to securely identify users.
129+
The frontend method, by its nature, is not secure as the data is transmitted through the client side. It is recommended to use the session token method to securely identify users.
130130
</Callout>
131131

132132
```jsx
133133
window.plugSDK.init({
134-
app_id: '<your_unique_app_id>',
135-
identity: {
136-
user_ref: string;
137-
user_traits?: {
138-
custom_fields?: object;
139-
display_name?: string;
140-
email?: string;
141-
phone_numbers?: string[];
142-
};
143-
})
134+
app_id: '<your_unique_app_id>',
135+
identity: {
136+
user_ref: string;
137+
user_traits?: { // optional
138+
custom_fields?: object; // optional
139+
display_name?: string; // optional
140+
email?: string; // optional
141+
phone_numbers?: string[]; // optional
142+
}
143+
}
144+
})
144145
```
145146

146147
You can add or update the data in `user_traits` by using the `updateIdentity` method on the PLuG SDK. Attached is a sample code snippet for the same.
147148

148149
```jsx
149150
window.plugSDK.updateIdentity({
150-
user_traits?: {
151-
custom_fields?: object;
152-
display_name?: string;
153-
email?: string;
154-
phone_numbers?: string[];
155-
};
151+
user_traits: {
152+
custom_fields?: object; // optional
153+
display_name?: string; // optional
154+
email?: string; // optional
155+
phone_numbers?: string[]; // optional
156+
}
156157
})
157-
158158
```
159159

160160

0 commit comments

Comments
 (0)