Skip to content

Update identify-web-user.mdx #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Jun 23, 2025
Merged
Changes from 4 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8380d25
Update identify-web-user.mdx
Atul-Butola Apr 2, 2025
1cc90b3
Update identify-web-user.mdx
Atul-Butola Apr 8, 2025
8cc62a7
Update identify-web-user.mdx
Atul-Butola Apr 8, 2025
6132d27
Update identify-web-user.mdx
Atul-Butola Apr 8, 2025
906f16e
Update identify-web-user.mdx
Atul-Butola Apr 8, 2025
7d1aae9
Merge branch 'main' into Plug-info
Atul-Butola Apr 8, 2025
e5ddb8a
Update user-identity.mdx
Atul-Butola Apr 8, 2025
d3ba331
Update user-identity.mdx
Atul-Butola Apr 10, 2025
11f2846
update documentation
sambhavjain9138 Apr 10, 2025
e9d872d
final changes
sambhavjain9138 Apr 10, 2025
9c7bac5
Merge branch 'main' into Plug-info
Atul-Butola Apr 10, 2025
7f910f5
nit
sambhavjain9138 Apr 10, 2025
ffee3fe
Merge branch 'Plug-info' of ssh://github.com/devrev/fern-api-docs int…
sambhavjain9138 Apr 10, 2025
c4e69ec
nit
sambhavjain9138 Apr 10, 2025
584a1d9
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
95843a4
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
85ff888
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
cea6183
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
5e4bce7
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
1b803fd
Update fern/docs/pages/plug-sdk/web/user-identity.mdx
sambhavjain9138 Apr 11, 2025
8424394
merge main
sambhavjain9138 Jun 22, 2025
127fa24
update status code and trouble shooting
sambhavjain9138 Jun 22, 2025
93c311e
address comments
sambhavjain9138 Jun 22, 2025
e34e754
merged main
sambhavjain9138 Jun 23, 2025
564e2f5
Update fern/docs/pages/sdks/web/user-identity.mdx
sambhavjain9138 Jun 23, 2025
d2267a2
nit
sambhavjain9138 Jun 23, 2025
4f69730
Update user-identity.mdx
Atul-Butola Jun 23, 2025
f0d0763
Update user-identity.mdx
Atul-Butola Jun 23, 2025
c91d11f
Update user-identity.mdx
fern-support Jun 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 54 additions & 24 deletions fern/docs/pages/plug-sdk/identify-web-user.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,60 @@ You can pass custom traits, as shown above, not only for `users` but also for `w

If you prefer a two-level structure, where users are directly associated with an account instead of a workspace, you can provide the `user_ref` and details along with the `account_ref` and details.

**Attributes for users**

|Attributes |Description |Type |
|---|---|---|
|`user_ref` |A unique user reference that the DevRev app uses for identifying your users. This parameter is required. |string |
|`email` |The email address of the customer. It's used for sending email notifications of any support messages. |string |
|`display_name` |The name of the user that's shown on the widget. |string |
|`phone_numbers` |The mobile number of the customer. |array |

**Attributes for workspaces**

|Attributes |Description |Type |
|---|---|---|
|`workspace_ref` |A unique reference for the user's workspace. If not provided, and an account reference is passed, the user is directly attached to the account. |string |
|`display_name` |The name of the workspace that's shown on the widget. |string |

**Attributes for accounts**

|Attributes |Description |Type |
|---|---|---|
|`account_ref` |A unique reference for the account. |string |
|`display_name` | The name of the account that's shown on the widget. |string |
|`domains` |The domain names of the accounts that the users belongs to. |array |
| `phone_numbers` |The phone number associated with the account. |array |
**Attributes for [users](https://developer.devrev.ai/public/api-reference/dev-users/product-builders-and-service-providers)**

| Attributes | Description | Type | Required | Unique |
|---------------|-----------------------------------------------------------------------------|--------|----------|--------|
| user_ref | A unique user reference that the DevRev app uses for identifying your users. This parameter is required. | string | ✅ | Yes |
| email | The email address of the customer. It's used for sending email notifications of any support messages. | string | ❌ | No |
| display_name | The name of the user that's shown on the widget. | string | ❌ | No |
| phone_numbers | The customer's mobile number, which must adhere to the E.164 format. | array | ❌ * | No |

* If nothing is specified, a system-generated name will be assigned to the user.

**Attributes for [workspaces](https://developer.devrev.ai/public/api-reference/rev-orgs/workspaces)**

| Attributes | Description | Type | Required | Unique |
|-----------------|--------------------------------------------------------------------------------------------------------------------|--------|----------|--------|
| `workspace_ref` | A unique reference for the user's workspace. If not provided, and an account reference is passed, the user is directly attached to the account. | string | ❌ | - |
| `display_name` | The name of the workspace that's shown on the widget. | string | - | ✅ |

**Attributes for [accounts](https://developer.devrev.ai/public/api-reference/accounts/accounts)**

| Attributes | Description | Type | Required | Unique |
|-----------------|-------------------------------------------------------------------------------------------------------------------|--------|----------|--------|
| `account_ref` | A unique reference for the account. | string | ❌ | - |
| `display_name` | The name of the account that's shown on the widget. | string | - | ✅ |
| `domains` | Use a unique format like 'devrev.ai'. Formats such as 'https://devrev.ai' or 'www.devrev.ai' are not valid. | array | - | ✅ |
| `phone_numbers` | The phone number associated with the account must be in E.164 format. | array | - | - |


### How resolution works

In a DevOrg, we utilize unique identifiers to handle objects. If an object doesn't exist, we create it and then attempt to link it. For example, here's how it operates:

User reference:
- A user reference is mandatory, ensuring its constant presence.
- If a user with the provided reference doesn't exist, the system automatically creates the user.

This approach ensures efficient management and integration of objects within the DevOrg.

| Workspace Ref | Account Ref | Results |
|---------------|-------------|------------------------------------------------------------------------------------------------------|
| ✅ | ✅ | If neither exists: System creates the account first, then creates the workspace. User is linked to both. |
| | | If account exists but workspace doesn't: System creates the workspace under the existing account. User is linked to both. |
| | | If workspace exists under different account: System returns an error, as workspaces cannot be moved between accounts. |
| ✅ | ❌ | If workspace doesn’t exist: System creates a new account and workspace (if needed). User is linked to both. |
| ❌ | ✅ | If the account doesn’t exist: An account is created, and the user is linked with the account. |
| ❌ | ❌ | No action on account or workspace. The user is returned. |



### Best practices

- Ensure the email field is filled out. This helps the support team accurately identify users and prevents duplicate entries when integrating with systems like email integration or outreach.
- If only an account and user are needed, you can omit workspace traits. This strategy helps prevent duplicate conflicts at the workspace level and maintains a clear object hierarchy.
- Ensure that unique attributes and reference identifiers (Refs) are aligned to avoid conflicts.

## Pass the session token

Expand Down