Skip to content

Commit 9bd3f38

Browse files
address review comments
1 parent 6132570 commit 9bd3f38

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
-97.1 KB
Binary file not shown.

fern/docs/pages/sdks/web/user-identity.mdx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,20 @@ For users who are logged into your website, you can identify them in PLuG to ena
44

55
To implement user identification, you need to generate a session token for each user who visits your website. This token is created using your application access token combined with customer information, and must be generated on your backend to keep the application token secure.
66

7-
<img src="../../../img/plug-verified-user-identification.png" width="400" />
7+
```mermaid
8+
sequenceDiagram
9+
participant User as Your User
10+
participant Frontend as Your Frontend
11+
participant Backend as Your Backend
12+
participant DevRev as DevRev's Backend
13+
14+
User->>Frontend: (1) User is known<br/>(via Signup, Login)
15+
Frontend->>Backend: (2) Send user details
16+
Backend->>DevRev: (3) auth-tokens.create API call
17+
DevRev-->>Backend: (4) Return RevUser Session Token
18+
Backend-->>Frontend: (5) Return Session Token
19+
Frontend->>Frontend: (6) Call plugSDK.init() with token
20+
```
821

922
## Generate an application access token
1023

@@ -240,7 +253,6 @@ window.plugSDK.init({
240253
identity: {},
241254
});
242255
```
243-
<Callout intent="note">
244256
If you're using the PLuG SDK for recording user sessions, calling the `shutdown()` method will stop the ongoing session recording. Re-initializing with the `init()` method will then start a new session recording. To avoid losing continuity, you can pass the details of the ongoing session recording when re-initializing PLuG.
245257
```jsx
246258
// Get the ongoing session details
@@ -266,5 +278,4 @@ window.plugSDK.init({
266278
identity: {},
267279
});
268280
```
269-
</Callout>
270281

0 commit comments

Comments
 (0)