Skip to content

Commit

Permalink
Update Client Backend SDK docs to match BAPI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisintech committed Jul 5, 2024
1 parent 880bccc commit 2806acc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions docs/references/backend/client/get-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ title: getClient()
description: Use Clerk's Backend SDK to retrieve a single client by its ID.
---

{/* clerk/javascript file: https://github.com/clerk/javascript/blob/main/packages/backend/src/api/endpoints/ClientApi.ts#L19 */}

# `getClient()`

Retrieves a single [`Client`](/docs/references/javascript/client) by its ID, if the ID is valid.
Retrieves a single [`Client`](/docs/references/javascript/client).

```tsx
function getClient: (clientId: string) => Promise<Client>;
Expand All @@ -20,19 +22,19 @@ function getClient: (clientId: string) => Promise<Client>;
## Example

```tsx
const clientId = 'client_2b6J9fCrQt0KRCCtFu7WCIQvSfd';
const clientId = 'client_123';

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

console.log(response);
/*
_Client {
id: 'client_2b6J9fCrQt0KRCCtFu7WCIQvSfd',
sessionIds: [ 'sess_2b6M8I4VZ1wMtgXGQeDe3SJD3cG' ],
id: 'client_123',
sessionIds: [ 'sess_123' ],
sessions: [ [_Session] ],
signInId: null,
signUpId: null,
lastActiveSessionId: 'sess_2b6M8I4VZ1wMtgXGQeDe3SJD3cG',
lastActiveSessionId: 'sess_123',
createdAt: 1705529444202,
updatedAt: 1705530913279
}
Expand Down
4 changes: 3 additions & 1 deletion docs/references/backend/client/verify-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ title: verifyClient()
description: Use Clerk's Backend SDK to retrieve a client for a given session token, if the session is active.
---

{/* clerk/javascript file: https://github.com/clerk/javascript/blob/main/packages/backend/src/api/endpoints/ClientApi.ts#L27 */}

# `verifyClient()`

Retrieves a [`Client`](/docs/references/javascript/client) for a given session token, if the session is active.
Verifies the [`Client`](/docs/references/javascript/client) in the provided token.

```tsx
function verifyClient: (token: string) => Promise<Client>;
Expand Down

0 comments on commit 2806acc

Please sign in to comment.