mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
* docs: cleanup auth docs * docs: update auth docs * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml Co-authored-by: dng <danny@supabase.io> * Update spec/supabase_js_v2_legacy.yml * update auth docs * add supabase auth admin api overview page * resolve PR comments * resolve PR comments * update auth docs with latest tsdocs Co-authored-by: dng <danny@supabase.io>
57 lines
1.2 KiB
Plaintext
57 lines
1.2 KiB
Plaintext
---
|
|
id: auth-admin-getuserbyid
|
|
title: 'getUserById()'
|
|
slug: /auth-admin-getuserbyid
|
|
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 user by id.
|
|
|
|
```js
|
|
const { data, error } = await supabase.auth.admin.getUserById(1)
|
|
```
|
|
|
|
## Parameters
|
|
|
|
<ul className="method-list-group">
|
|
|
|
<li className="method-list-item">
|
|
<h4 className="method-list-item-label">
|
|
<span className="method-list-item-label-name">
|
|
uid
|
|
</span>
|
|
<span className="method-list-item-label-badge required">
|
|
required
|
|
</span>
|
|
<span className="method-list-item-validation">
|
|
<code>string</code>
|
|
</span>
|
|
</h4>
|
|
<div class="method-list-item-description">
|
|
|
|
The user's unique identifier
|
|
|
|
This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
## Notes
|
|
|
|
- Fetches the user object from the database based on the user's id.
|
|
- The `getUserById()` method requires the user's id which maps to the `auth.users.id` column.
|
|
|
|
## Examples
|
|
|
|
### Fetch the user object using the access_token jwt.
|
|
|
|
```js
|
|
const { data, error } = await supabase.auth.admin.getUserById(1)
|
|
```
|