/auth
Search
K
Comment on page

getUsers( )

Function to return users for the given app or a specific organization. This is a paginated API.

Usage

const { paginatedResponse } = await client.user.getUsers({});
console.log('Number of users: ', paginatedResponse?.data?.length);

Return Value

{
paginatedResponse?: {
data?: {
id: string;
clientID: string;
organizationID?: string;
wallet: string;
nickname?: string;
roles: string[];
metadata?: ObjectMap;
createdAt: string;
updatedAt: string;
}[];
pageInfo: {
cursor?: string;
hasMore: boolean;
};
};
error: ErrorMessage | null;
headers: Object;
statusCode: number;
}

Configuration

organizationID (optional)

String that represents an organization's ID.
const { paginatedResponse } = await client.user.getUsers({
organizationID: 'org.abc',
});
console.log('Number of users: ', paginatedResponse?.data?.length);

cursor (optional)

String that represents the next page to fetch.
const { paginatedResponse } = await client.user.getUsers({
cursor: 'cursor.1234',
});
console.log('Number of users: ', paginatedResponse?.data?.length);