Skip to main content
Version: v2 RC

generateLink()

Generates email links and OTPs to be sent via a custom email provider.

const { data, error } = await supabase.auth.admin.generateLink({
type: 'signup',
email: 'email@example.com',
options: {
'password': 'secret'
}
})

Parameters

  • GenerateLinkParamsrequiredGenerateSignupLinkParams | GenerateInviteOrMagiclinkParams | GenerateRecoveryLinkParams | GenerateEmailChangeLinkParams

    No description provided.

      Properties
    • GenerateSignupLinkParamsrequiredobject

      No description provided.

    • GenerateRecoveryLinkParamsrequiredobject

      No description provided.

    • GenerateInviteOrMagiclinkParamsrequiredobject

      No description provided.

    • GenerateEmailChangeLinkParamsrequiredobject

      No description provided.

Examples

const { data, error } = await supabase.auth.admin.generateLink({
type: 'signup',
email: 'email@example.com',
options: {
'password': 'secret'
}
})
const { data, error } = await supabase.auth.admin.generateLink({
type: 'invite',
email: 'email@example.com'
})
const { data, error } = await supabase.auth.admin.generateLink({
type: 'magiclink',
email: 'email@example.com'
})
const { data, error } = await supabase.auth.admin.generateLink({
type: 'recovery',
email: 'email@example.com'
})
const { data, error } = await supabase.auth.admin.generateLink({
type: 'email_change_current',
email: 'old.email@example.com',
newEmail: 'new.email@example.com'
})