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:

  1. 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.

  2. metaData (object): An object containing user data to be passed to the Beacon Bar.

Here's how to use it:

import {Beacon} from '@beacon.li/bar';
Beacon.loadUser(userId, {
    name: 'John Doe',
    isPremiumUser: true,
    currentPlan: 'Premium'
});

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:

  1. Personalize the support experience by addressing users by name.

  2. Configure rules to show/hide commands based on user meta data.

  3. Gather context about users, such as their subscription status or preferences.

  4. Provide more relevant and tailored responses during interactions.

  5. Improve user engagement and satisfaction.

Last updated