--- id: auth-api-generatelink title: "generateLink()" slug: auth-api-generatelink custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml --- import Tabs from '@theme/Tabs'; import TabsPanel from '@theme/TabsPanel'; Generates links to be sent via email or other. ## Parameters ## Notes - Requires a `service_role` key. - This function should only be called on a server. Never expose your `service_role` key in the browser. ## Examples ### Generate invite link. ```js const { data: user, error } = await supabase.auth.api.generateLink({ type: 'invite', email: 'email@example.com' }) ```