Creates a new sign-in token and associates it with the given user.
By default, sign-in tokens expire in 30 days.
You can optionally supply a different duration in seconds using the expires_in_seconds property.
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->signInTokens->create(
request: $request
);
if ($response->signInToken !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\CreateSignInTokenRequestBody | ✔️ | The request object to use for the request. |
?Operations\CreateSignInTokenResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ClerkErrors | 404, 422 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Revokes a pending sign-in token
declare(strict_types=1);
require 'vendor/autoload.php';
use Clerk\Backend;
$sdk = Backend\ClerkBackend::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$response = $sdk->signInTokens->revoke(
signInTokenId: '<id>'
);
if ($response->signInToken !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
signInTokenId |
string | ✔️ | The ID of the sign-in token to be revoked |
?Operations\RevokeSignInTokenResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\ClerkErrors | 400, 404 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |