--- 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: { users }, error, } = await supabase.auth.admin.listUsers() ``` ## Examples ### Get a full list of users. ```js const { data: { users }, error, } = await supabase.auth.admin.listUsers() ```