How to get User Profile information

Last updated 02/16/2024

Before using the code snippet below, make sure you have added the initialization script tag.

During the authentication process, Bread & Butter collects information about the user, which we make available to your website via our BreadButter.getProfile() call. This allows you to pull that information down to your site to fill in a form, display for the user, or store in a local database for future use.

The call below allows you to fetch information about the current user:

BreadButter.getProfile((user_profile, suggested_provider, device_verified) => {
    console.log('GET PROFILE CALL COMPLETE');
});

});


If provided by the user via authentication, the following information is available in the user_profile object of the callback function:

user_profile.email_addressThe user’s email address
user_profile.first_nameThe user’s first name
user_profile.last_nameThe user’s last name
user_profile.profile_image_urlAbsolute URL to the user’s profile image

The following information is available in the suggested_provider object:

suggested_provider.idpA string value for the identity provider e.g. “linkedin”, “github”, “microsoft”, etc.
suggested_provider.nameA more descriptive string for the provider e.g. “BreadButter GitHub”
suggested_provider.typeA string value for the type of authentication e.g. “social”

The device_verified value in the callback is a boolean value indicating whether or not the user has been authenticated.


Don’t use Bread & Butter? Want to learn more about how Bread & Butter solves the four biggest problems facing marketers today? Book a demo and see how Bread & Butter is helping marketers make the most of their first-party data