Read All Users

import authefyNodeClient from './path/to/@authefy/node-client';

/*
    filter(optional) - filters the query with selected information
    sort(optional) - ASC | DESC sorts the order of the edges
    size(optional) - limits the page size
    after(optional) - query users after the given cursor
    before(optional) - query users before the given cursor
*/

await authefyNodeClient.user.readAll({
    filter: {
        username: 'kuudahi',
        isEmailVerified: true,
        isVerified: true,
    },
    sort: 'ASC',
    size: 5,
    after: 'gejtiwzosusivozi',
    before: 'mulfikpahfafiwas'
})
/* 
    returns: {
        edges: { node: User; cursor: string };
        endCursor?: string;
        totalCount: number;
    }
*/

User Object:

type User {
    id: string;
    externalId?: string;
    username: string;
    groups: string[];
    isEmailVerified: boolean;
    isVerified: boolean;
    details: Record<string, any>;
}

Last updated

Was this helpful?