Skip to main content

buildfire.auth

Users search dialog is accessible via the plugin SDK from the control side of the plugin. It allows plugin developers to show user search dialog and allow the app owner to select users and get their data in callback.

Methods

showUsersSearchDialog()

buildfire.auth.showUsersSearchDialog(options,callback)

This builtin dialog helps you to show a dialog in order to be used to select users.

buildfire.auth.showUsersSearchDialog(null, (err, result) => {
if (err) return console.log(err);

if (result) {
console.log("Selected users", result.users);
console.log("Selected user ids", result.userIds);
}
});

options

NameTypeRequiredDescriptionDefault
maxUsersnumbernoSpecifies the maximum number of selectable users. If not provided, there is no limit on selection.null

callback(err, result)

Callback function after something is done

NameTypeDescription
errstringerror string, null when operation is successful
resultobjectan object that has users and userIds returned. null whene no user is selected or if dialog is canceled
result
NameTypeDescription
users[object]an array of objects containing the selected users
userIds[string]an array containing the IDs for the selected users
result.users[]
NameTypeDescription
firstNamestringThe user first name
lastNamestringThe user last name
displayNamestringThe user display name
usernamestringThe username
isActiveboolIndicates whether the user is active or not
userProfileobjectThe user profile object
imageUrlstringThe url for the user profile image
Example
{
"users": [
{
"firstName": "Bob",
"lastName": "Steve",
"displayName": "Bob Steve",
"username": "example@buildfire.com",
"isActive": true,
"userProfile": {},
"imageUrl": "imageUrl"
},
{
"firstName": "Sara",
"lastName": "Conor",
"displayName": "Sarah Conor",
"username": "example1@buildfire.com",
"isActive": true,
"userProfile": {},
"imageUrl": "imageUrl"
}
],
"userIds": ["5dc0832959fda11018ffb5e8", "5dc0836c59fda11018ffb5ea"]
}