Kotlin: Generate an email link

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

Examples

Generate a signup link

val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Signup) \{
    email = "example@email.com"
    password = "secretpassword"
\}

Generate an invite link

val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Invite) \{
    email = "example@email.com"
\}

Generate a magic link

val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.MagicLink) \{
    email = "example@email.com"
\}

Generate a recovery link

val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Recovery) \{
    email = "example@email.com"
\}

Generate links to change current email address

// generate an email change link to be sent to the current email address
val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.EmailChangeCurrent) \{
    email = "example@email.com"
    newEmail = "newEmail@email.com"
\}

// generate an email change link to be sent to the new email address
val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.EmailChangeNew) \{
    email = "example@email.com"
    newEmail = "newEmail@email.com"
\}