Loading User Data into BeaconBar
To enhance the user experience and provide personalized support or interactions, you can load user data into beacon using the @beacon.li/bar
package. This allows you to pass relevant user information to these components.
Loading User Data into BeaconBar
To load user data into BeaconBar, you can use the Beacon.loadUser
method. This method takes two parameters:
userId
(string): The unique identifier of the user, which can be an email address or a database ID or any other uniquely generated ID to map to that user.metaData
(object): An object containing user data to be passed to the Beacon Bar.
Here's how to use it:
In the example above, we're loading user data for a user with the provided userId
. The metaData
object contains user-specific information such as the user's name, premium status, and current subscription plan. This data can be used to personalize the user experience or gather relevant context about the user.
Benefits of Loading User Data
Loading user data into beacon allows you to:
Personalize the support experience by addressing users by name.
Configure rules to show/hide commands based on user meta data.
Gather context about users, such as their subscription status or preferences.
Provide more relevant and tailored responses during interactions.
Improve user engagement and satisfaction.
Last updated