Skip to content

Commit 102b651

Browse files
committed
Revise User Object
1 parent 09dbc96 commit 102b651

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

website/docs/targeting/user-object.mdx

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
22
id: user-object
33
title: User Object
4-
description: The User Object is a collection of *user attributes* that describe the properties of a user. The User Object is essential for targeting.
4+
description: The User Object is a collection of user attributes that store various pieces of information about a user. The User Object is essential for targeting.
55
---
66

7-
The *User Object* is a collection of *user attributes* that describe the properties of a user. The *User Object* is necessary to evaluate [Targeting Rules](../targeting-rule/targeting-rule-overview) and [Percentage Options](../percentage-options).
8-
It allows you to pass the user attributes that are referenced in the rules of the feature flag to the ConfigCat SDK. The User Object represents a user in your application.
7+
The _User Object_ represents a user in your application. It is a collection of *user attributes* that store various pieces of information about the user.
8+
9+
The User Object is necessary to evaluate [Targeting Rules](../targeting-rule/targeting-rule-overview) and [Percentage Options](../percentage-options).
10+
It allows you to pass the user attributes that are referenced in the rules of the feature flag to the ConfigCat SDK.
911

1012
:::info
11-
The *User Object* is essential if you'd like to use ConfigCat's [Targeting](../targeting-overview) feature.
13+
The User Object is essential if you'd like to use ConfigCat's [Targeting](../targeting-overview) feature.
1214
:::
1315

1416
## The relationship between the User Object and Targeting Rules
@@ -19,23 +21,23 @@ The *User Object* is essential if you'd like to use ConfigCat's [Targeting](../t
1921

2022
## Security and privacy concerns
2123

22-
ConfigCat was designed with security and privacy in mind. The evaluation process is entirely implemented within the SDKs, meaning **your users' sensitive data never leaves your system**. The data flow is one-way – from ConfigCat CDN servers to your SDKs – and ConfigCat does not receive or store any attributes of the User Object passed to the SDKs. This design prioritizes the privacy and security of user data.
24+
ConfigCat was designed with security and privacy in mind. The feature flag evaluation process is entirely implemented within the SDKs, meaning **your users' sensitive data never leaves your system**. The data flow is one-way – from ConfigCat CDN servers to your SDKs – and ConfigCat does not receive or store any attributes of the User Object passed to the SDKs. This design prioritizes the privacy and security of user data.
2325

2426
## Anatomy of the User Object
2527

26-
The data that can be stored in the User Object:
28+
The User Object offers the following properties to store user data:
2729

2830
| Attribute | Description |
2931
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
30-
| Identifier | **REQUIRED.** We recommend adding a UserID, Email address, or SessionID. |
31-
| Email | Optional. By adding this parameter, you can create Email address-based targeting. e.g.: Only turn on a feature for users with @example.com addresses. |
32-
| Country | Optional. Fill this for location or country-based targeting. e.g.: Turn on a feature for users in Canada only. |
33-
| Custom | Optional. This parameter will let you create targeting based on any user data you like. e.g: Age, Subscription type, User role, Device type, App version number, etc. |
32+
| Identifier | **REQUIRED.** We recommend using a user ID, email address, or session ID. |
33+
| Email | Optional. Setting this allows you to target users based on their email address. E.g.: "Turn on a feature for users with **@example.com** addresses only." |
34+
| Country | Optional. Specify this for location or country-based targeting. E.g.: "Turn on a feature for users in Canada only." |
35+
| Custom | Optional. A map/dictionary that lets you set custom user attributes to target users based on any user data. E.g.: age, subscription type, user role, device type, app version, etc. |
3436

3537
### Code example
3638

3739
```js
38-
let userObject = new configcat.User(
40+
const userObject = new configcat.User(
3941
'#UNIQUE-USER-IDENTIFIER#', // Identifier attribute (Required)
4042
'john@example.com', // Email attribute (Optional)
4143
'United Kingdom', // Country attribute (Optional)
@@ -48,40 +50,42 @@ let userObject = new configcat.User(
4850

4951
### Identifier attribute
5052

51-
Unique identifier of a user in your application. This is a **REQUIRED** attribute which enables ConfigCat to differentiate your users from each other and to evaluate the feature flag values for Percentage Options.
53+
The unique identifier of a user in your application. This is a **REQUIRED** attribute, which enables ConfigCat to differentiate your users from each other and to evaluate Targeting Rules and Percentage Options.
5254

53-
Our recommendation as an identifier:
55+
Our recommendation for an identifier:
5456

55-
- User ID - If you have one in your application, you can use the same User ID with ConfigCat.
56-
- Email address - In most cases, adding an email address works perfectly here, as long as it is unique.
57-
- SessionId - This is useful for targeting users who are not logged in to your application.
57+
- User ID - If such an ID is available in your application, you can as well use it with ConfigCat.
58+
- Email address - In most cases, using an email address works perfectly - as long as it is unique.
59+
- Session ID - This is useful for targeting users who are not logged in to your application.
5860

5961
### Custom attributes
6062

61-
To use custom attributes, you need to pass a User Object containing the `custom` attribute to the ConfigCat SDK.
63+
To use custom attributes, you need to pass a User Object containing the `custom` property to the ConfigCat SDK.
6264

63-
> The custom attribute's value can be multiple types. e.g.: string, number, date, array of strings, etc. Check the [SDK reference](../../sdk-reference/overview) for more details.
65+
:::info
66+
The custom attribute's value can be of multiple types: e.g. string, number, date, array of strings, etc. Check the [SDK reference](../../sdk-reference/overview) for more details.
67+
:::
6468

6569
## Examples
6670

6771
### Enable a feature for most valuable customers only
6872

6973
#### Context
70-
Our demo company, Whisker Co. developed a new feature called `Personalized Layout` to enhance the user experience of their most valuable customers.
74+
Our demo company, Whisker Co. developed a new feature called **Personalized Layout** to enhance the user experience of their most valuable customers.
7175

7276
#### Goal
73-
We want to enable the `Personalized Layout` feature but only for customers with the `Pro` subscription type.
77+
We want to enable the **Personalized Layout** feature but only for customers with a **Pro** subscription.
7478

7579
#### Solution
76-
To achieve this goal, we need a custom attribute named e.g. `SubscriptionType`, which stores the subscription type of the customer.
80+
To achieve this goal, we need a custom attribute named e.g. **SubscriptionType**, which stores the subscription type of the customer.
7781

78-
This allows us to define a Targeting Rule that turns on the feature for the customers whose `SubscriptionType` attribute is `Pro`. Finally, we need to make sure that the "To all others" value is OFF so the feature is turned off for the rest of the customers.
82+
This allows us to define a Targeting Rule that turns on the feature for the customers whose **SubscriptionType** attribute is **Pro**. Finally, we need to make sure that the "To all others" value is **OFF** so the feature is turned off for the rest of the customers.
7983

8084
#### Dashboard
8185
![User Object example](/assets/targeting/user-object/user-object-example.png)
8286

8387
#### Code
84-
Add the `SubscriptionType` custom attribute to the User Object in your application code.
88+
Add the **SubscriptionType** custom attribute to the User Object in your application code.
8589

8690
```js
8791
const userObject = new configcat.User(userId, undefined, undefined, {

0 commit comments

Comments
 (0)