Files
supabase/apps/reference/_supabase_js/sdk/auth-api-listusers.mdx
T

46 lines
728 B
Plaintext

---
id: auth-api-listusers
title: "listUsers()"
slug: /auth-api-listusers
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase_js_v2_ref.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.api.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.api.listUsers()
```