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-go/blob/main/passwordless.go
#asyncSendPasswordlessEmail

SendPasswordlessEmail sends a passwordless authentication email

paramctxcontext.Context

Request context

paramemailstring

Email address.

paramoptionsSendPasswordlessOptions

Optional request settings.

returnsSendPasswordlessResponse

Send passwordless.

template := scalekit.TemplateTypeSignin
resp, err := scalekitClient.Passwordless().SendPasswordlessEmail(ctx, "user@example.com", &scalekit.SendPasswordlessOptions{
Template: &template,
MagiclinkAuthUri: "https://myapp.com/auth/callback",
State: "state",
ExpiresIn: 1800,
TemplateVariables: map[string]string{
"app_name": "My App",
},
})
if err != nil {
// handle
}
_ = resp.AuthRequestId
clientPasswordlesshttps://github.com/scalekit-inc/scalekit-sdk-go/blob/main/passwordless.go
#asyncVerifyPasswordlessEmail

VerifyPasswordlessEmail verifies a passwordless authentication

paramctxcontext.Context

Request context

paramoptionsVerifyPasswordlessOptions

Optional request settings.

returnsVerifyPasswordLessResponse

Verified claims or result.

verified, err := scalekitClient.Passwordless().VerifyPasswordlessEmail(ctx, &scalekit.VerifyPasswordlessOptions{
Code: "123456",
AuthRequestId: "auth_req_123",
})
if err != nil {
// handle
}
_ = verified
clientPasswordlesshttps://github.com/scalekit-inc/scalekit-sdk-go/blob/main/passwordless.go
#asyncResendPasswordlessEmail

ResendPasswordlessEmail resends a passwordless authentication email

paramctxcontext.Context

Request context

paramauthRequestIdstring

Auth request id.

returnsSendPasswordlessResponse

Send passwordless.

resp, err := scalekitClient.Passwordless().ResendPasswordlessEmail(ctx, "auth_req_123")
if err != nil {
// handle
}
_ = resp.AuthRequestId