Docs

getClient()

Retrieves a single Client.

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

    The ID of the client to retrieve.

const clientId = 'client_123';

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

console.log(response);
/*
_Client {
  id: 'client_123',
  sessionIds: [ 'sess_123' ],
  sessions: [ [_Session] ],
  signInId: null,
  signUpId: null,
  lastActiveSessionId: 'sess_123',
  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?