Files
supabase/web/docs/gotrue/client/signup.mdx
T

134 lines
2.1 KiB
Plaintext

---
id: signup
title: "signUp"
slug: signup
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Creates a new user.
## Parameters
<ul className="method-list-group">
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
credentials
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
object
</span>
</h4>
<div class="method-list-item-description">
The user login details.
</div>
<ul className="method-list-group">
<h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
password
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
string
</span>
</h4>
<div class="method-list-item-description">
The user's password.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
email
</span>
<span className="method-list-item-label-badge required">
required
</span>
<span className="method-list-item-validation">
string
</span>
</h4>
<div class="method-list-item-description">
The user's email address.
</div>
</li>
</ul>
</li>
</ul>
## Notes
- A user can sign up either via email or OAuth.
- If you provide `email`, `password` is also required
- If you provide `access_token`, `password` is also required
## Examples
### Sign up
<Tabs
defaultValue="js"
groupId="libraries"
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
<TabItem value="js">
```js
const { error, data } = await auth.signUp({
email: 'example@email.com',
password: 'example-password',
})
```
</TabItem>
<TabItem value="py">
```py
# Not yet implemented
```
</TabItem>
</Tabs>