createSignInToken()
Creates a new sign-in token for the given user. By default, sign-in tokens expire in 30 days. You can optionally specify a custom expiration time in seconds using the expiresInSeconds parameter.
Returns the created SignInToken object.
function createSignInToken(params: CreateSignInTokensParams): Promise<SignInToken>const userId = 'user_123'
const expiresInSeconds = 60 * 60 * 24 * 7 // 1 week
const response = await clerkClient.signInTokens.createSignInToken({
userId,
expiresInSeconds,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint POST/sign_in_tokens. See the BAPI reference for more information.
Feedback
Last updated on