Files
supabase/apps/reference/_supabase_js/generated/auth-admin-inviteuserbyemail.mdx
2022-08-18 15:54:30 +08:00

79 lines
1.6 KiB
Plaintext

---
id: auth-admin-inviteuserbyemail
title: 'inviteUserByEmail()'
slug: /auth-admin-inviteuserbyemail
custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_js_v2_legacy.yml
---
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Sends an invite link to an email address.
```js
const { data, error } = await supabase.auth.admin.inviteUserByEmail(
'email@example.com'
)
```
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
email
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>string</code>
</span>
</h4>
<div class="method-list-item-description">
The email address of the user.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
options
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
<code>object</code>
</span>
</h4>
<div class="method-list-item-description">
No description provided.
</div>
</li>
</ul>
## 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
### Basic example.
```js
const { data, error } = await supabase.auth.admin.inviteUserByEmail(
'email@example.com'
)
```