Skip to content

Latest commit

 

History

History
130 lines (85 loc) · 7.7 KB

README.md

File metadata and controls

130 lines (85 loc) · 7.7 KB

Clients

(Clients)

Overview

The Client object tracks sessions, as well as the state of any sign in and sign up attempts, for a given device. https://clerk.com/docs/reference/clerkjs/client

Available Operations

  • List - List all clients ⚠️ Deprecated
  • Verify - Verify a client
  • Get - Get a client

List

Returns a list of all clients. The clients are returned sorted by creation date, with the newest clients appearing first. Warning: the endpoint is being deprecated and will be removed in future versions.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Clients.ListAsync(
    limit: 20,
    offset: 10
);

// handle response

Parameters

Parameter Type Required Description Example
Limit long Applies a limit to the number of results returned.
Can be used for paginating the results together with offset.
20
Offset long Skip the first offset results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with limit.
10

Response

GetClientListResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 410, 422 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Verify

Verifies the client in the provided token

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

VerifyClientRequestBody req = new VerifyClientRequestBody() {
    Token = "jwt_token_example",
};

var res = await sdk.Clients.VerifyAsync(req);

// handle response

Parameters

Parameter Type Required Description
request VerifyClientRequestBody ✔️ The request object to use for the request.

Response

VerifyClientResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*

Get

Returns the details of a client.

Example Usage

using Clerk.BackendAPI;
using Clerk.BackendAPI.Models.Operations;
using Clerk.BackendAPI.Models.Components;

var sdk = new ClerkBackendApi(bearerAuth: "<YOUR_BEARER_TOKEN_HERE>");

var res = await sdk.Clients.GetAsync(clientId: "cli_123456789");

// handle response

Parameters

Parameter Type Required Description Example
ClientId string ✔️ Client ID. cli_123456789

Response

GetClientResponse

Errors

Error Type Status Code Content Type
Clerk.BackendAPI.Models.Errors.ClerkErrors 400, 401, 404 application/json
Clerk.BackendAPI.Models.Errors.SDKError 4XX, 5XX */*