Files
supabase/apps/reference/_supabase_js/generated/auth-getsession.mdx

25 lines
519 B
Plaintext

---
id: auth-getsession
title: 'getSession()'
slug: /auth-getsession
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'
Returns the session data, refreshing it if necessary.
If no session is detected, the session returned will be null.
```js
const { data, error } = supabase.auth.getSession()
```
## Examples
### Get the session data
```js
const { data, error } = supabase.auth.getSession()
```