Docs

getClient()

Retrieves a single Client by its ID, if the ID is valid.

function getClient: (clientId: string) => Promise<Client>;
  • Name
    clientId
    Type
    string
    Description

    The ID of the client to retrieve.

const clientId = 'client_2b6J9fCrQt0KRCCtFu7WCIQvSfd';

const response = await clerkClient.clients.getClient(clientId);

console.log(response);
/*
_Client {
  id: 'client_2b6J9fCrQt0KRCCtFu7WCIQvSfd',
  sessionIds: [ 'sess_2b6M8I4VZ1wMtgXGQeDe3SJD3cG' ],
  sessions: [ [_Session] ],
  signInId: null,
  signUpId: null,
  lastActiveSessionId: 'sess_2b6M8I4VZ1wMtgXGQeDe3SJD3cG',
  createdAt: 1705529444202,
  updatedAt: 1705530913279
}
*/

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint GET/clients/{client_id}. See the BAPI reference for more details.

Feedback

What did you think of this content?