Product Fruits needs to identify users to work properly. For instance, we have to know which tours or announcements the particular user was interacting with. If we didn't know this, we could show Product Fruits content either multiple times or never. This is usually not the expected behavior.
User information is transferred through the JavaScript installation. The only required user property is username
. This must be a unique identifier of the user. It can be the username, e-mail, ID, or any unique immutable value assigned to this user. If you don't want to transfer real usernames to Product Fruits, hash them (i.e. MD5, SHA1).
If you plan to use one of our two-way sync integrations, you should send e-mails to the username
field. Many two-way synchronizations need this for proper user pairing.
username
- this is the only required fieldfirstname
- accepts stringslastname
- accepts stringssignUpAt
- accepts strings. The standard JSON Data format is highly recommended (yyyy-mm-ddThh:mm:ss
)role
- accepts strings. If you need multiple roles, use a custom propertyYou can also pass custom properties to users. If you want to segment your content (display different things to different users), this is important to set up correctly.
You can pass custom user information to the props
field. This object can hold any property with one of these types:
We recommend using standard naming for these properties. Try to avoid spaces and other special characters in names.
User identity verification is an optional feature you can enable in the workspace settings. It makes sure no one can impersonate another user. It requires additional backend work on your side. You can read more here.
const userInfo = { username: 'john@example.com', // REQUIRED, must be unique
email: 'john@example.com',
firstname: 'John',
lastname: 'Smith',
signUpAt: '2021-12-30T23:50:55', // Sign up date (yyyy-mm-ddThh:mm:ss)
role: 'admin',
hmac: { // optional, required when using User identity verification
},
props: {
myCustomProp1: 'my custom value',
myCustomProp2: 21447,
myCustomProp3: ['first', 'second'],
}
};