© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
2 replies
Clifton

Generate Email OTP via Edge Function

The docs say you can generate an OTP and send it to an email account. I want to send the OTP using an edge function (so I can customize the email).

What
type
type
do I use for emailing the user the OTP code?

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

Is this even possible? I don't want to use magic links because then I have to manage multiple redirect locations. I prefer to send a code to their email and authenticate from wherever they attempted to sign in.

Docs reference: https://supabase.com/docs/reference/javascript/auth-admin-generatelink
JavaScript: Generate an email link | Supabase Docs
Supabase API reference for JavaScript: Generate an email link
JavaScript: Generate an email link | Supabase Docs
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

OTP via email for signIn
SupabaseSSupabase / help-and-questions
4y ago
Queues archiving via edge function
SupabaseSSupabase / help-and-questions
13mo ago
call an edge function via webhook
SupabaseSSupabase / help-and-questions
7mo ago
Invoking an edge function via Supabase trigger/function
SupabaseSSupabase / help-and-questions
3y ago