---
id: auth-user
title: "user()"
slug: auth-user
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
---

import Tabs from '@theme/Tabs';
import TabsPanel from '@theme/TabsPanel';

Inside a browser context, `user()` will return the user data, if there is a logged in user.

For server-side management, you can get a user through `auth.api.getUserByCookie()`

<Tabs
  defaultActiveId="js"
  groupId="reference/supabase-js"
  values={[{ label: 'JavaScript', value: 'js' }]}>

<TabsPanel id="js" label="js">

```js
const user = supabase.auth.user()
```


</TabsPanel>

</Tabs>





## Notes

This method gets the user object from memory.










## Examples

### Get the logged in user



<Tabs
  defaultActiveId="js"
  groupId="reference/supabase-js"
  values={[{ label: 'JavaScript', value: 'js' }]}>

<TabsPanel id="js" label="js">

```js
const user = supabase.auth.user()
```


</TabsPanel>

</Tabs>