mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 05:44:25 +08:00
31 lines
718 B
Plaintext
31 lines
718 B
Plaintext
---
|
|
id: auth-admin-listusers
|
|
title: 'listUsers()'
|
|
slug: /auth-admin-listusers
|
|
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'
|
|
|
|
Get a list of users.
|
|
|
|
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
|
|
```js
|
|
const { data: user, error } = await supabase.auth.admin.listUsers()
|
|
```
|
|
|
|
## Notes
|
|
|
|
- Requires a `service_role` key.
|
|
- This function should be called on a server. Never expose your `service_role` key in the browser.
|
|
|
|
## Examples
|
|
|
|
### Get a full list of users.
|
|
|
|
```js
|
|
const { data: user, error } = await supabase.auth.admin.listUsers()
|
|
```
|