Skip to content
Scalekit Docs
Talk to an EngineerDashboard

Passwordless login

Send and verify passwordless login codes

Use the passwordless client to send and verify email magic links or one-time codes for sign-in.

Call send, then verify with the code or link token from the user’s email to complete login.

clientPasswordlesshttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/passwordless.ts
#asyncsendPasswordlessEmail

Send a passwordless authentication email

paramemailstring

The email address to send the passwordless link to

paramoptionsobject

Optional fields: template, state, magiclinkAuthUri, expiresIn, templateVariables.

template, state, magiclinkAuthUri, expiresIn, templateVariables
returnsSendPasswordlessResponse

Send passwordless.

// template: template
// state: Opaque state string
// magiclinkAuthUri: magiclink auth uri
// expiresIn: expires in
// templateVariables: template variables
const response = await scalekit.passwordless.sendPasswordlessEmail(
'user@example.com',
{
template: 'SIGNIN',
state: 'random-state',
expiresIn: 3600
}
);
console.log('Auth Request ID:', response.authRequestId);
clientPasswordlesshttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/passwordless.ts
#asyncverifyPasswordlessEmail

Verify a passwordless authentication code or link token

paramcredentialobject

code, linkToken.

code, linkToken
paramauthRequestIdstring

Optional. Optional auth request ID from the send response

returnsVerifyPasswordLessResponse

Verified claims.

// code: Authorization code
// linkToken: link token
const response = await scalekit.passwordless.verifyPasswordlessEmail(
{ code: '123456' },
'auth_request_id'
);
console.log('Email:', response.email);
clientPasswordlesshttps://github.com/scalekit-inc/scalekit-sdk-node/blob/main/src/passwordless.ts
#asyncresendPasswordlessEmail

Resend a passwordless authentication email

paramauthRequestIdstring

The auth request ID from the original send response

returnsSendPasswordlessResponse

Send passwordless.

const response = await scalekit.passwordless.resendPasswordlessEmail('auth_request_id');