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.
sendPasswordlessEmail
Section titled “sendPasswordlessEmail”#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 variablesconst response = await scalekit.passwordless.sendPasswordlessEmail( 'user@example.com', { template: 'SIGNIN', state: 'random-state', expiresIn: 3600 });
console.log('Auth Request ID:', response.authRequestId);verifyPasswordlessEmail
Section titled “verifyPasswordlessEmail”#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 tokenconst response = await scalekit.passwordless.verifyPasswordlessEmail( { code: '123456' }, 'auth_request_id');
console.log('Email:', response.email);resendPasswordlessEmail
Section titled “resendPasswordlessEmail”#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');