(clients)
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
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.
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$response = $sdk->clients->list(
limit: 10,
offset: 0
);
if ($response->clientList !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
limit |
?int | ➖ | Applies a limit to the number of results returned. Can be used for paginating the results together with offset . |
offset |
?int | ➖ | Skip the first offset results when paginating.Needs to be an integer greater or equal to zero. To be used in conjunction with limit . |
?Operations\GetClientListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors | 400, 401, 410, 422 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Verifies the client in the provided token
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
use Clerk\Backend\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$request = new Operations\VerifyClientRequestBody();
$response = $sdk->clients->verify(
request: $request
);
if ($response->client !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\VerifyClientRequestBody | ✔️ | The request object to use for the request. |
?Operations\VerifyClientResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors1 | 400, 401, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |
Returns the details of a client.
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Backend\ClerkBackend::builder()->setSecurity($security)->build();
$response = $sdk->clients->get(
clientId: '<id>'
);
if ($response->client !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
clientId |
string | ✔️ | Client ID. |
Error Type | Status Code | Content Type |
---|---|---|
Errors\ClerkErrors2 | 400, 401, 404 | application/json |
Errors\SDKException | 4XX, 5XX | */* |