mirror of
https://github.com/supabase/supabase.git
synced 2026-07-02 06:44:35 +08:00
25 lines
519 B
Plaintext
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()
|
|
```
|