--- id: auth-api-generatelink title: 'generateLink()' slug: auth-api-generatelink custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v1_legacy.yml --- import Tabs from '@theme/Tabs' import TabItem from '@theme/TabItem' 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( 'invite', 'email@example.com' ) ```