mirror of
https://github.com/supabase/supabase.git
synced 2026-05-31 01:42:45 +08:00
migrates everything from ipip's branch
This commit is contained in:
120
apps/temp-docs/docs/javascript/auth-api-deleteuser.mdx
Normal file
120
apps/temp-docs/docs/javascript/auth-api-deleteuser.mdx
Normal file
@@ -0,0 +1,120 @@
|
||||
---
|
||||
id: auth-api-deleteuser
|
||||
title: "deleteUser()"
|
||||
slug: auth-api-deleteuser
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabsPanel from '@theme/TabsPanel';
|
||||
|
||||
Delete a user. Requires a `service_role` key.
|
||||
|
||||
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
values={[{ label: 'JavaScript', value: 'js' }]}>
|
||||
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.deleteUser(
|
||||
'715ed5db-f090-4b8c-a067-640ecee36aa0',
|
||||
'YOUR_SERVICE_ROLE_KEY'
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
uid
|
||||
</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 user uid you want to remove.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
jwt
|
||||
</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">
|
||||
|
||||
A valid JWT. Must be a full-access API key (e.g. service_role key).
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- Requires a `service_role` key.
|
||||
- This function should be called on a server. Never expose your `service_role` key in the browser.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Remove a user completely.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultActiveId="js"
|
||||
groupId="reference/supabase-js"
|
||||
values={[{ label: 'JavaScript', value: 'js' }]}>
|
||||
|
||||
<TabsPanel id="js" label="js">
|
||||
|
||||
```js
|
||||
const { data: user, error } = await supabase.auth.api.deleteUser(
|
||||
'715ed5db-f090-4b8c-a067-640ecee36aa0',
|
||||
'YOUR_SERVICE_ROLE_KEY'
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
</TabsPanel>
|
||||
|
||||
</Tabs>
|
||||
Reference in New Issue
Block a user