Use this method to get multiple users' metadata simultaneously, such as the name, bio, social link, etc.
Usage in your script
const response = await altura.getUsers();
// customize options
const options = {
perPage: 20,
page: 1,
sortBy: 'name',
sortDir: 'asc'
}
const response = await altura.getUsers(options);
// filter documents by any properties
const response = await altura.getUsers(
{}, // default options
{
name: 'AlturaNFT'
} //fetching users with name AlturaNFT
)
const users = response.users;
const userCount = response.count;
const response: { users: IAlturaUser[], count: number } = await altura.getUsers();
// customize options
const options = {
perPage: 20,
page: 1,
sortBy: 'name',
sortDir: 'asc'
}
const response: { users: IAlturaUser[], count: number } = await altura.getUsers(options);
// filter documents by any properties
const response: {users: IAlturaUser[], count: number} = await altura.getUsers(
{}, // default options
{
name: 'AlturaNFT'
} //fetching users with name AlturaNFT
)
const users = response.users;
const userCount = response.count;
Parameters
Parameter
Type
Required
Description
Amount of users per page.
The field to sort the users by (any field in the user schema may be used)
Choose to sort in ascending (asc) or descending (desc) order