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: website/docs/targeting/user-object.mdx
+27-23Lines changed: 27 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,16 @@
1
1
---
2
2
id: user-object
3
3
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.
5
5
---
6
6
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.
9
11
10
12
:::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.
12
14
:::
13
15
14
16
## 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
19
21
20
22
## Security and privacy concerns
21
23
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.
23
25
24
26
## Anatomy of the User Object
25
27
26
-
The data that can be stored in the User Object:
28
+
The User Object offers the following properties to store user data:
| 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. |
@@ -48,40 +50,42 @@ let userObject = new configcat.User(
48
50
49
51
### Identifier attribute
50
52
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.
52
54
53
-
Our recommendation as an identifier:
55
+
Our recommendation for an identifier:
54
56
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.
58
60
59
61
### Custom attributes
60
62
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.
62
64
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
+
:::
64
68
65
69
## Examples
66
70
67
71
### Enable a feature for most valuable customers only
68
72
69
73
#### 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.
71
75
72
76
#### 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.
74
78
75
79
#### 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.
77
81
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.
0 commit comments