Compare commits
128 Commits
@nhost/rea
...
@nhost/cor
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
365b806755 | ||
|
|
74025a2d90 | ||
|
|
ebd6f86ea3 | ||
|
|
7b23d33d9b | ||
|
|
de177710f7 | ||
|
|
eebfddb48e | ||
|
|
f5df7eaa2d | ||
|
|
0b4028b1d6 | ||
|
|
f2da21026b | ||
|
|
a8233ea621 | ||
|
|
f300d8b9f1 | ||
|
|
3b625acd96 | ||
|
|
116e23cb13 | ||
|
|
954aa43e49 | ||
|
|
de6f862c4c | ||
|
|
5025333fb4 | ||
|
|
b3991ea9d9 | ||
|
|
239db617f3 | ||
|
|
6d6c8b3e2e | ||
|
|
169f163c99 | ||
|
|
5ddd7eda22 | ||
|
|
00d50f404a | ||
|
|
b52b4fca2d | ||
|
|
9f55f4890e | ||
|
|
284890b437 | ||
|
|
1e3cb855f0 | ||
|
|
aaf575f0af | ||
|
|
ff3427ccdb | ||
|
|
3834d80a0a | ||
|
|
8fcc3fd560 | ||
|
|
616e320421 | ||
|
|
ff8fdc4db4 | ||
|
|
b732bc51e8 | ||
|
|
8b88d6c553 | ||
|
|
af192fbb66 | ||
|
|
b7c031d7e0 | ||
|
|
05e91d93a8 | ||
|
|
261f001a99 | ||
|
|
ddb965c7cf | ||
|
|
ff8af4912b | ||
|
|
948aebcf42 | ||
|
|
51a4d7a343 | ||
|
|
d521218146 | ||
|
|
9a1685c2eb | ||
|
|
fb8f58503f | ||
|
|
86409c2f18 | ||
|
|
f7d8c061a0 | ||
|
|
eb59a07c3f | ||
|
|
27add80f95 | ||
|
|
cc60a845f3 | ||
|
|
aeea44e4e8 | ||
|
|
d273825cee | ||
|
|
177733f4b1 | ||
|
|
efd33a7115 | ||
|
|
e4fe166992 | ||
|
|
d9f221b625 | ||
|
|
e0f5bf3396 | ||
|
|
17bd23460f | ||
|
|
52c30c25a9 | ||
|
|
989bc54544 | ||
|
|
5781cb0f9c | ||
|
|
24f9ed4c4d | ||
|
|
2b447af8a7 | ||
|
|
2485c83de3 | ||
|
|
707877477f | ||
|
|
756e1af52d | ||
|
|
7f771e2e8f | ||
|
|
a737863c2b | ||
|
|
ca2a61089a | ||
|
|
7432db0fe8 | ||
|
|
9c25e65df6 | ||
|
|
e345895fd8 | ||
|
|
cba7996dcf | ||
|
|
d7ceda6ae6 | ||
|
|
4e19b7309d | ||
|
|
de8a7d5512 | ||
|
|
7e7aa5adc4 | ||
|
|
1ed948952a | ||
|
|
55b0a8f4b9 | ||
|
|
1ce55c5568 | ||
|
|
fabd1da04c | ||
|
|
53f5226d0c | ||
|
|
e339cba384 | ||
|
|
c14d12e04d | ||
|
|
03370da2f4 | ||
|
|
87d32b2639 | ||
|
|
61b5fb549c | ||
|
|
28cd8dc5c5 | ||
|
|
fb93d8c1af | ||
|
|
f4e6aea9c1 | ||
|
|
d49b837abb | ||
|
|
49545c058b | ||
|
|
765340f7b2 | ||
|
|
2c3d9b11a6 | ||
|
|
b1678eaad3 | ||
|
|
f1c16dba6e | ||
|
|
aa1fdf6c2c | ||
|
|
bebf9e1f2b | ||
|
|
2413c10283 | ||
|
|
0f7fbdab97 | ||
|
|
14e5fd63a6 | ||
|
|
2446913836 | ||
|
|
1f88a9f47a | ||
|
|
261e37cda4 | ||
|
|
5ee395ea8e | ||
|
|
e5f00394ae | ||
|
|
dd08aef4cc | ||
|
|
4ab85815a0 | ||
|
|
828633ffc9 | ||
|
|
1b0902079b | ||
|
|
7b7527a5e6 | ||
|
|
f719d47ed3 | ||
|
|
8cc88533b1 | ||
|
|
71de2bd0c5 | ||
|
|
66d204331b | ||
|
|
ee288fbc5f | ||
|
|
1a38b5dca3 | ||
|
|
e0bd8cf14b | ||
|
|
e0cfcafead | ||
|
|
1da0ff9109 | ||
|
|
75a1428114 | ||
|
|
d82d830849 | ||
|
|
2def59fc6c | ||
|
|
64ceb2c6bf | ||
|
|
3ee007620c | ||
|
|
c08230ae95 | ||
|
|
18df8921fd | ||
|
|
b9cf8172a0 |
@@ -18,5 +18,7 @@ module.exports = {
|
||||
useTabs: false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
importOrderSeparation: true,
|
||||
importOrderSortSpecifiers: true
|
||||
}
|
||||
|
||||
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -2,6 +2,7 @@
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
/packages @plmercereau
|
||||
/packages/docgen @szilarddoro
|
||||
/.github/workflows @plmercereau
|
||||
/docs/ @guicurcio
|
||||
/examples/ @plmercereau @guicurcio @FuzzyReason
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -15,7 +15,6 @@ logs/
|
||||
/.vscode/
|
||||
.eslintcache
|
||||
.yarnclean
|
||||
.husky
|
||||
|
||||
# Directories
|
||||
coverage/
|
||||
@@ -50,4 +49,8 @@ todo.md
|
||||
.netlify
|
||||
.monorepo-example
|
||||
|
||||
.next
|
||||
.next
|
||||
|
||||
# TypeDoc output
|
||||
|
||||
.docgen
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
6
.lintstagedrc.json
Normal file
6
.lintstagedrc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"packages/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core)/src/**/*.{js,ts,jsx,tsx}": [
|
||||
"pnpm docgen",
|
||||
"git add docs"
|
||||
]
|
||||
}
|
||||
28
README.md
28
README.md
@@ -98,7 +98,7 @@ Nhost is frontend agnostic, which means Nhost works with all frontend frameworks
|
||||
|
||||
Nhost libraries and tools
|
||||
|
||||
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/sdk)
|
||||
- [JavaScript/TypeScript SDK](https://docs.nhost.io/reference/javascript)
|
||||
- [Dart and Flutter SDK](https://github.com/nhost/nhost-dart)
|
||||
- [Nhost CLI](https://docs.nhost.io/reference/cli)
|
||||
- [Nhost React](https://docs.nhost.io/reference/react)
|
||||
@@ -213,6 +213,13 @@ Here are some ways of contributing to making Nhost better:
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dbarrosop">
|
||||
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
|
||||
<br />
|
||||
<sub><b>David Barroso</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hajek-raven">
|
||||
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
|
||||
@@ -247,15 +254,15 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Savin Vadim</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ahmic">
|
||||
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
|
||||
<br />
|
||||
<sub><b>Amir Ahmic</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/akd-io">
|
||||
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
|
||||
@@ -290,15 +297,22 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Helio Alves</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nkhdo">
|
||||
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
|
||||
<br />
|
||||
<sub><b>Hoang Do</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jladuval">
|
||||
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
|
||||
<br />
|
||||
<sub><b>Jacob Duval</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ghoshnirmalya">
|
||||
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
|
||||
|
||||
@@ -9,7 +9,7 @@ Nhost provides a ready-to-use authentication service, integrated with Nhost Java
|
||||
|
||||
## Getting Started
|
||||
|
||||
Sign up a user with the [Nhost JavaScript SDK](/reference/sdk):
|
||||
Sign up a user with the [Nhost JavaScript SDK](/reference/javascript):
|
||||
|
||||
```js
|
||||
import { NhostClient } from '@nhost/nhost-js';
|
||||
@@ -48,7 +48,7 @@ query {
|
||||
|
||||
Nhost authentication uses two tokens: Access tokens and refresh tokens.
|
||||
|
||||
[Nhost JavaScript SDK](/reference/sdk) automatically handles access and refresh tokens.
|
||||
[Nhost JavaScript SDK](/reference/javascript) automatically handles access and refresh tokens.
|
||||
|
||||
### Access tokens
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ To make sure we can fetch all user data (email, profile picture and name). For t
|
||||
|
||||
## Sign In users in your app
|
||||
|
||||
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
|
||||
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
|
||||
|
||||
```js
|
||||
nhost.auth.signIn({
|
||||
|
||||
@@ -43,7 +43,7 @@ Follow this guide to sign in users with GitHub with your Nhost App.
|
||||
|
||||
## Sign In users in your app
|
||||
|
||||
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
|
||||
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
|
||||
|
||||
```js
|
||||
nhost.auth.signIn({
|
||||
|
||||
@@ -23,7 +23,7 @@ You need to set client ID and client secret for each provider that you want to e
|
||||
|
||||
## Implementing sign-in experience
|
||||
|
||||
Use the [Nhost JavaScript SDK](/reference/sdk) and the `signIn()` method to implement social sign-in in your app,
|
||||
Use the [Nhost JavaScript SDK](/reference/javascript) and the `signIn()` method to implement social sign-in in your app,
|
||||
|
||||
Here's an example of how to implement sign-in with GitHub:
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ Follow this guide to sign in users with LinkedIn with your Nhost App.
|
||||
|
||||
## Sign In users in your app
|
||||
|
||||
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
|
||||
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
|
||||
|
||||
```js
|
||||
nhost.auth.signIn({
|
||||
|
||||
@@ -43,7 +43,7 @@ Follow this guide to sign in users with Spotify with your Nhost App.
|
||||
|
||||
## Sign In users in your app
|
||||
|
||||
Use the [Nhost JavaScript client](/reference/sdk) to sign in users in your app:
|
||||
Use the [Nhost JavaScript client](/reference/javascript) to sign in users in your app:
|
||||
|
||||
```js
|
||||
nhost.auth.signIn({
|
||||
|
||||
@@ -20,7 +20,7 @@ To interact with the GraphQL API it's recommended to use a GraphQL client:
|
||||
- [React Query](https://react-query.tanstack.com/graphql)
|
||||
- [SWR](https://swr.vercel.app/docs/data-fetching#graphql)
|
||||
|
||||
It's also possible to use the built-in [GraphQL client](/reference/sdk/graphql) in the Nhost JavaScript client.
|
||||
It's also possible to use the built-in [GraphQL client](/reference/javascript/nhost-js/graphql) in the Nhost JavaScript client.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ https://[app-subdomain].nhost.run/v1/functions/my-endpoint
|
||||
|
||||
The environment variable `NHOST_BACKEND_URL` will have the correct value.
|
||||
|
||||
```bash
|
||||
{{NHOST_BACKEND_URL}}/v1/functions/my-endpoint
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Security
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"label": "Auth"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: signUp()
|
||||
sidebar_label: signUp()
|
||||
slug: /reference/javascript/auth/sign-up
|
||||
description: Use `signUp` to sign up users using email an password.
|
||||
---
|
||||
|
||||
# `signUp()`
|
||||
|
||||
Use `signUp` to sign up users using email an password.
|
||||
|
||||
```ts
|
||||
auth.signIn({ email, password }) // email password
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignUpEmailPasswordParams`](/reference/docgen/javascript/auth/types/sign-up-email-password-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------ | :-------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>password</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>options</span> | `SignUpOptions` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: signIn()
|
||||
sidebar_label: signIn()
|
||||
slug: /reference/javascript/auth/sign-in
|
||||
description: Use `signIn` to sign in users using email and password, passwordless (email or sms) or an external provider. `signIn` can be used in various ways depending on the parameters.
|
||||
---
|
||||
|
||||
# `signIn()`
|
||||
|
||||
Use `signIn` to sign in users using email and password, passwordless
|
||||
(email or sms) or an external provider.
|
||||
`signIn` can be used in various ways depending on the parameters.
|
||||
|
||||
```ts
|
||||
signIn({ email, password })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignInParams`](/reference/docgen/javascript/auth/types/sign-in-params)
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign in with email and password
|
||||
|
||||
```ts
|
||||
signIn({ email, password })
|
||||
```
|
||||
|
||||
### Sign in with an external provider (e.g: Google or Facebook)
|
||||
|
||||
```ts
|
||||
signIn({ provider })
|
||||
```
|
||||
|
||||
### Passwordless sign in with email (magic link)
|
||||
|
||||
```ts
|
||||
signIn({ email }) // [step 1/2] Passwordless sign in with Email (Magic Link)
|
||||
signIn({ email, otp }) // [step 2/2] Finish passwordless sign in with email (OTP)
|
||||
```
|
||||
|
||||
### Passwordless sign in with SMS
|
||||
|
||||
```ts
|
||||
signIn({ phoneNumber }) // [step 1/2] Passwordless sign in with SMS
|
||||
signIn({ phoneNumber, otp }) // [step 2/2] Finish passwordless sign in with SMS (OTP)
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: signOut()
|
||||
sidebar_label: signOut()
|
||||
slug: /reference/javascript/auth/sign-out
|
||||
description: Use `signOut` to sign out a user
|
||||
---
|
||||
|
||||
# `signOut()`
|
||||
|
||||
Use `signOut` to sign out a user
|
||||
|
||||
```ts
|
||||
signOut()
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> `{ all: boolean }`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: resetPassword()
|
||||
sidebar_label: resetPassword()
|
||||
slug: /reference/javascript/auth/reset-password
|
||||
description: Use `resetPassword` to reset a user's password.
|
||||
---
|
||||
|
||||
# `resetPassword()`
|
||||
|
||||
Use `resetPassword` to reset a user's password.
|
||||
|
||||
```ts
|
||||
auth.resetPassword({ email })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ResetPasswordParams`](/reference/docgen/javascript/auth/types/reset-password-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: changePassword()
|
||||
sidebar_label: changePassword()
|
||||
slug: /reference/javascript/auth/change-password
|
||||
description: Use `changePassword` to change a user's password.
|
||||
---
|
||||
|
||||
# `changePassword()`
|
||||
|
||||
Use `changePassword` to change a user's password.
|
||||
|
||||
```ts
|
||||
auth.changePassword({ newPassword })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`ChangePasswordParams`](/reference/docgen/javascript/auth/types/change-password-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :--------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>newPassword</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: sendVerificationEmail()
|
||||
sidebar_label: sendVerificationEmail()
|
||||
slug: /reference/javascript/auth/send-verification-email
|
||||
description: Use `sendVerificationEmail` to send a verification email to the specified email.
|
||||
---
|
||||
|
||||
# `sendVerificationEmail()`
|
||||
|
||||
Use `sendVerificationEmail` to send a verification email
|
||||
to the specified email.
|
||||
|
||||
```ts
|
||||
auth.sendVerificationEmail({ email })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SendVerificationEmailParams`](/reference/docgen/javascript/auth/types/send-verification-email-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>options</span> | `RedirectOption` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: changeEmail()
|
||||
sidebar_label: changeEmail()
|
||||
slug: /reference/javascript/auth/change-email
|
||||
description: Use `changeEmail` to change a user's email
|
||||
---
|
||||
|
||||
# `changeEmail()`
|
||||
|
||||
Use `changeEmail` to change a user's email
|
||||
|
||||
```ts
|
||||
auth.changeEmail({ newEmail })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangeEmailParams`](/reference/docgen/javascript/auth/types/change-email-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newEmail</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: deanonymize()
|
||||
sidebar_label: deanonymize()
|
||||
slug: /reference/javascript/auth/deanonymize
|
||||
description: Use `deanonymize` to deanonymize a user
|
||||
---
|
||||
|
||||
# `deanonymize()`
|
||||
|
||||
Use `deanonymize` to deanonymize a user
|
||||
|
||||
```ts
|
||||
auth.deanonymize({ signInMethod: 'email-password', email })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`DeanonymizeParams`](/reference/docgen/javascript/auth/types/deanonymize-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------------- | :------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>email</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>signInMethod</span> | `"email-password"` \| `"passwordless"` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>allowedRoles</span> | `Array<string>` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>defaultRole</span> | `string` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>connection</span> | `"email"` \| `"sms"` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>password</span> | `string` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: onTokenChanged()
|
||||
sidebar_label: onTokenChanged()
|
||||
slug: /reference/javascript/auth/on-token-changed
|
||||
description: Use `onTokenChanged` to add a custom function that will trigger whenever the access and refresh token is changed.
|
||||
---
|
||||
|
||||
# `onTokenChanged()`
|
||||
|
||||
Use `onTokenChanged` to add a custom function that will trigger whenever
|
||||
the access and refresh token is changed.
|
||||
|
||||
```ts
|
||||
auth.onTokenChanged(() => console.log('access token changed'))
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`OnTokenChangedFunction`](/reference/docgen/javascript/auth/types/on-token-changed-function)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: onAuthStateChanged()
|
||||
sidebar_label: onAuthStateChanged()
|
||||
slug: /reference/javascript/auth/on-auth-state-changed
|
||||
description: Use `onAuthStateChanged` to add a custom function that will trigger whenever the state of the user changed. Ex from signed in to signed out or vice versa.
|
||||
---
|
||||
|
||||
# `onAuthStateChanged()`
|
||||
|
||||
Use `onAuthStateChanged` to add a custom function that will trigger
|
||||
whenever the state of the user changed. Ex from signed in to signed out or
|
||||
vice versa.
|
||||
|
||||
```ts
|
||||
auth.onAuthStateChanged((event, session) => {
|
||||
console.log(
|
||||
`Auth state changed. State is now ${event} with session: ${session}`
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`AuthChangedFunction`](/reference/docgen/javascript/auth/types/auth-changed-function)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: isAuthenticated()
|
||||
sidebar_label: isAuthenticated()
|
||||
slug: /reference/javascript/auth/is-authenticated
|
||||
description: Use `isAuthenticated` to check if the user is authenticated or not.
|
||||
---
|
||||
|
||||
# `isAuthenticated()`
|
||||
|
||||
Use `isAuthenticated` to check if the user is authenticated or not.
|
||||
|
||||
```ts
|
||||
const = auth.isAuthenticated();
|
||||
|
||||
if (authenticated) {
|
||||
console.log('User is authenticated');
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: isAuthenticatedAsync()
|
||||
sidebar_label: isAuthenticatedAsync()
|
||||
slug: /reference/javascript/auth/is-authenticated-async
|
||||
description: Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
|
||||
---
|
||||
|
||||
# `isAuthenticatedAsync()`
|
||||
|
||||
Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
|
||||
|
||||
```ts
|
||||
const isAuthenticated = awiat auth.isAuthenticatedAsync();
|
||||
|
||||
if (isAuthenticated) {
|
||||
console.log('User is authenticated');
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getAuthenticationStatus()
|
||||
sidebar_label: getAuthenticationStatus()
|
||||
slug: /reference/javascript/auth/get-authentication-status
|
||||
description: Use `getAuthenticationStatus` to get the authentication status of the user.
|
||||
---
|
||||
|
||||
# `getAuthenticationStatus()`
|
||||
|
||||
Use `getAuthenticationStatus` to get the authentication status of the user.
|
||||
|
||||
```ts
|
||||
const { isAuthenticated, isLoading } = auth.getAuthenticationStatus()
|
||||
|
||||
if (isLoading) {
|
||||
console.log('Loading...')
|
||||
}
|
||||
|
||||
if (isAuthenticated) {
|
||||
console.log('User is authenticated')
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getJWTToken()
|
||||
sidebar_label: getJWTToken()
|
||||
slug: /reference/javascript/auth/get-jwt-token
|
||||
sidebar_class_name: deprecated
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `getJWTToken()`
|
||||
|
||||
:::caution Deprecated
|
||||
Use `getAccessToken()` instead.
|
||||
:::
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getAccessToken()
|
||||
sidebar_label: getAccessToken()
|
||||
slug: /reference/javascript/auth/get-access-token
|
||||
description: Use `getAccessToken` to get the logged in user's access token.
|
||||
---
|
||||
|
||||
# `getAccessToken()`
|
||||
|
||||
Use `getAccessToken` to get the logged in user's access token.
|
||||
|
||||
```ts
|
||||
const accessToken = auth.getAccessToken()
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getDecodedAccessToken()
|
||||
sidebar_label: getDecodedAccessToken()
|
||||
slug: /reference/javascript/auth/get-decoded-access-token
|
||||
description: Decode the current decoded access token (JWT), or return `null` if the user is not authenticated (no token)
|
||||
---
|
||||
|
||||
# `getDecodedAccessToken()`
|
||||
|
||||
Decode the current decoded access token (JWT), or return `null` if the user is not authenticated (no token)
|
||||
|
||||
**`@see`**
|
||||
|
||||
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getHasuraClaims()
|
||||
sidebar_label: getHasuraClaims()
|
||||
slug: /reference/javascript/auth/get-hasura-claims
|
||||
description: Decode the Hasura claims from the current access token (JWT) located in the `https://hasura.io/jwt/claims` namespace, or return `null` if the user is not authenticated (no token)
|
||||
---
|
||||
|
||||
# `getHasuraClaims()`
|
||||
|
||||
Decode the Hasura claims from the current access token (JWT) located in the `https://hasura.io/jwt/claims` namespace, or return `null` if the user is not authenticated (no token)
|
||||
|
||||
**`@see`**
|
||||
|
||||
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getHasuraClaim()
|
||||
sidebar_label: getHasuraClaim()
|
||||
slug: /reference/javascript/auth/get-hasura-claim
|
||||
description: Get the value of a given Hasura claim in the current access token (JWT). Returns null if the user is not authenticated, or if the claim is not in the token. Return `null` if the user is not authenticated (no token)
|
||||
---
|
||||
|
||||
# `getHasuraClaim()`
|
||||
|
||||
Get the value of a given Hasura claim in the current access token (JWT). Returns null if the user is not authenticated, or if the claim is not in the token.
|
||||
Return `null` if the user is not authenticated (no token)
|
||||
|
||||
**`@see`**
|
||||
|
||||
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/|Hasura documentation}
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
name of the variable. Automatically adds the `x-hasura-` prefix if it is missing
|
||||
|
||||
---
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: refreshSession()
|
||||
sidebar_label: refreshSession()
|
||||
slug: /reference/javascript/auth/refresh-session
|
||||
description: Use `refreshSession()` to refresh the current session or refresh the session with an provided `refreshToken`.
|
||||
---
|
||||
|
||||
# `refreshSession()`
|
||||
|
||||
Use `refreshSession()` to refresh the current session or refresh the
|
||||
session with an provided `refreshToken`.
|
||||
|
||||
```ts
|
||||
refreshToken()
|
||||
refreshToken(refreshToken)
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getSession()
|
||||
sidebar_label: getSession()
|
||||
slug: /reference/javascript/auth/get-session
|
||||
description: Use `getSession()` to get the current session.
|
||||
---
|
||||
|
||||
# `getSession()`
|
||||
|
||||
Use `getSession()` to get the current session.
|
||||
|
||||
```ts
|
||||
const session = getSession()
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getUser()
|
||||
sidebar_label: getUser()
|
||||
slug: /reference/javascript/auth/get-user
|
||||
description: Use `getUser()` to get the current user.
|
||||
---
|
||||
|
||||
# `getUser()`
|
||||
|
||||
Use `getUser()` to get the current user.
|
||||
|
||||
```ts
|
||||
const user = getUser()
|
||||
```
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: HasuraAuthClient
|
||||
sidebar_label: Auth
|
||||
description: No description provided.
|
||||
slug: /reference/javascript/auth
|
||||
---
|
||||
|
||||
# `HasuraAuthClient`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostAuthConstructorParams`](/reference/docgen/javascript/auth/types/nhost-auth-constructor-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>url</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>Client</span> | `AuthClient` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> | [`StorageSetter`](/reference/docgen/javascript/auth/types/storage-setter) | | Define a way to set information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> | [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter) | | Define a way to get information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type) | | |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage) | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"label": "Types",
|
||||
"position": 1,
|
||||
"className": "hidden",
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"slug": "/reference/docgen/javascript/auth/types"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiChangeEmailResponse
|
||||
sidebar_label: ApiChangeEmailResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiChangeEmailResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiChangePasswordResponse
|
||||
sidebar_label: ApiChangePasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiChangePasswordResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiDeanonymizeResponse
|
||||
sidebar_label: ApiDeanonymizeResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiDeanonymizeResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiError
|
||||
sidebar_label: ApiError
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiError`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">message</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">status</span>** <span className="optional-status">required</span> `number`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiRefreshTokenResponse
|
||||
sidebar_label: ApiRefreshTokenResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiRefreshTokenResponse`
|
||||
|
||||
```ts
|
||||
type ApiRefreshTokenResponse =
|
||||
| { session: null; error: ApiError }
|
||||
| { session: Session; error: null }
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiResetPasswordResponse
|
||||
sidebar_label: ApiResetPasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiResetPasswordResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSendVerificationEmailResponse
|
||||
sidebar_label: ApiSendVerificationEmailResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiSendVerificationEmailResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignInData
|
||||
sidebar_label: ApiSignInData
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiSignInData`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> [`Session`](/reference/docgen/javascript/auth/types/session)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>user</span> | `null` \| [`User`](/reference/docgen/javascript/auth/types/user) | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>refreshToken</span> | `string` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>accessTokenExpiresIn</span> | `number` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">session.</span>accessToken</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">required</span> `null` | [`Mfa`](/reference/docgen/javascript/auth/types/mfa)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignInResponse
|
||||
sidebar_label: ApiSignInResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiSignInResponse`
|
||||
|
||||
```ts
|
||||
type ApiSignInResponse =
|
||||
| { data: ApiSignInData; error: null }
|
||||
| { data: null; error: ApiError }
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignOutResponse
|
||||
sidebar_label: ApiSignOutResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiSignOutResponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ApiSignUpEmailPasswordResponse
|
||||
sidebar_label: ApiSignUpEmailPasswordResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ApiSignUpEmailPasswordResponse`
|
||||
|
||||
```ts
|
||||
type ApiSignUpEmailPasswordResponse =
|
||||
| { session: null; error: ApiError }
|
||||
| { session: Session; error: null }
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: AuthChangeEvent
|
||||
sidebar_label: AuthChangeEvent
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `AuthChangeEvent`
|
||||
|
||||
```ts
|
||||
type AuthChangeEvent = 'SIGNED_IN' | 'SIGNED_OUT'
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: AuthChangedFunction
|
||||
sidebar_label: AuthChangedFunction
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `AuthChangedFunction`
|
||||
|
||||
```ts
|
||||
type AuthChangedFunction = () => (
|
||||
event: AuthChangeEvent,
|
||||
session: Session | null
|
||||
) => void
|
||||
```
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ChangeEmailParams
|
||||
sidebar_label: ChangeEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ChangeEmailParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">newEmail</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ChangePasswordParams
|
||||
sidebar_label: ChangePasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ChangePasswordParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">newPassword</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ClientStorageType
|
||||
sidebar_label: ClientStorageType
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ClientStorageType`
|
||||
|
||||
```ts
|
||||
type ClientStorageType =
|
||||
| 'capacitor'
|
||||
| 'custom'
|
||||
| 'expo-secure-storage'
|
||||
| 'localStorage'
|
||||
| 'react-native'
|
||||
| 'web'
|
||||
```
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ClientStorage
|
||||
sidebar_label: ClientStorage
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ClientStorage`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">deleteItemAsync</span>** <span className="optional-status">optional</span> `(key: string) => void`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">getItemAsync</span>** <span className="optional-status">optional</span> `(key: string) => any`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">setItemAsync</span>** <span className="optional-status">optional</span> `(key: string, value: string) => void`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">remove</span>** <span className="optional-status">optional</span> `(options: { key: string }) => void`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">get</span>** <span className="optional-status">optional</span> `(options: { key: string }) => any`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">set</span>** <span className="optional-status">optional</span> `(options: { key: string, value: string }) => void`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">removeItem</span>** <span className="optional-status">optional</span> `(key: string) => void`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">getItem</span>** <span className="optional-status">optional</span> `(key: string) => any`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">setItem</span>** <span className="optional-status">optional</span> `(_key: string, _value: string) => void`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: DeanonymizeParams
|
||||
sidebar_label: DeanonymizeParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `DeanonymizeParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">signInMethod</span>** <span className="optional-status">required</span> `"email-password"` | `"passwordless"`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">allowedRoles</span>** <span className="optional-status">optional</span> `Array<string>`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">defaultRole</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> `"email"` | `"sms"`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
17
docs/docs/reference/docgen/javascript/auth/types/headers.mdx
Normal file
17
docs/docs/reference/docgen/javascript/auth/types/headers.mdx
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Headers
|
||||
sidebar_label: Headers
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `Headers`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">Authorization</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: LoginData
|
||||
sidebar_label: LoginData
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `LoginData`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
17
docs/docs/reference/docgen/javascript/auth/types/mfa.mdx
Normal file
17
docs/docs/reference/docgen/javascript/auth/types/mfa.mdx
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Mfa
|
||||
sidebar_label: Mfa
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `Mfa`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">ticket</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,91 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostAuthConstructorParams
|
||||
sidebar_label: NhostAuthConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `NhostAuthConstructorParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">start</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
:::caution Deprecated
|
||||
use autoSignIn instead
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
When set to true, will automatically refresh token before it expires
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageSetter</span>** <span className="optional-status">optional</span> [`StorageSetter`](/reference/docgen/javascript/auth/types/storage-setter)
|
||||
|
||||
Define a way to set information about the refresh token and its exipration date
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageGetter</span>** <span className="optional-status">optional</span> [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter)
|
||||
|
||||
Define a way to get information about the refresh token and its exipration date
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">clientStorageType</span>** <span className="optional-status">optional</span> [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type)
|
||||
|
||||
:::caution Deprecated
|
||||
Use clientStorageGetter and clientStorageSetter options instead
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
|
||||
|
||||
:::caution Deprecated
|
||||
Use clientStorageGetter and clientStorageSetter options instead
|
||||
:::
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :-------------------------------------------------------------------------------------------------------- | :-------------------------------------------------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | `(key: string) => void` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | `(key: string) => any` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | `(key: string, value: string) => void` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | `(options: { key: string }) => void` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | `(options: { key: string }) => any` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | `(options: { key: string, value: string }) => void` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | `(key: string) => void` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | `(key: string) => any` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | `(_key: string, _value: string) => void` | | |
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> `number`
|
||||
|
||||
Time interval until token refreshes, in seconds
|
||||
|
||||
---
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: OnTokenChangedFunction
|
||||
sidebar_label: OnTokenChangedFunction
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `OnTokenChangedFunction`
|
||||
|
||||
```ts
|
||||
type OnTokenChangedFunction = () => (session: Session | null) => void
|
||||
```
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Provider
|
||||
sidebar_label: Provider
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `Provider`
|
||||
|
||||
```ts
|
||||
type Provider =
|
||||
| 'apple'
|
||||
| 'facebook'
|
||||
| 'github'
|
||||
| 'google'
|
||||
| 'linkedin'
|
||||
| 'spotify'
|
||||
| 'twitter'
|
||||
| 'windowslive'
|
||||
| 'strava'
|
||||
| 'gitlab'
|
||||
| 'bitbucket'
|
||||
```
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: ResetPasswordParams
|
||||
sidebar_label: ResetPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `ResetPasswordParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SendVerificationEmailParams
|
||||
sidebar_label: SendVerificationEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SendVerificationEmailParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
|
||||
|
||||
---
|
||||
29
docs/docs/reference/docgen/javascript/auth/types/session.mdx
Normal file
29
docs/docs/reference/docgen/javascript/auth/types/session.mdx
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: Session
|
||||
sidebar_label: Session
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `Session`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessTokenExpiresIn</span>** <span className="optional-status">required</span> `number`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">user</span>** <span className="optional-status">required</span> `null` | [`User`](/reference/docgen/javascript/auth/types/user)
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInEmailPasswordParams
|
||||
sidebar_label: SignInEmailPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInEmailPasswordParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInParams
|
||||
sidebar_label: SignInParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInParams`
|
||||
|
||||
```ts
|
||||
type SignInParams =
|
||||
| SignInEmailPasswordParams
|
||||
| SignInPasswordlessEmailParams
|
||||
| SignInPasswordlessSmsOtpParams
|
||||
| SignInPasswordlessSmsParams
|
||||
| SignInWithProviderOptions
|
||||
```
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInPasswordlessEmailParams
|
||||
sidebar_label: SignInPasswordlessEmailParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInPasswordlessEmailParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInPasswordlessSmsOtpParams
|
||||
sidebar_label: SignInPasswordlessSmsOtpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInPasswordlessSmsOtpParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInPasswordlessSmsParams
|
||||
sidebar_label: SignInPasswordlessSmsParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInPasswordlessSmsParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `PasswordlessOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInReponse
|
||||
sidebar_label: SignInReponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInReponse`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">session</span>** <span className="optional-status">required</span> `null` | [`Session`](/reference/docgen/javascript/auth/types/session)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | [`ApiError`](/reference/docgen/javascript/auth/types/api-error)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">mfa</span>** <span className="optional-status">optional</span> `{ enabled: boolean, ticket: string }`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">providerUrl</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">provider</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignInWithProviderOptions
|
||||
sidebar_label: SignInWithProviderOptions
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignInWithProviderOptions`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">provider</span>** <span className="optional-status">required</span> [`Provider`](/reference/docgen/javascript/auth/types/provider)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `ProviderOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpEmailPasswordParams
|
||||
sidebar_label: SignUpEmailPasswordParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignUpEmailPasswordParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `SignUpOptions`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpParams
|
||||
sidebar_label: SignUpParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignUpParams`
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: SignUpResponse
|
||||
sidebar_label: SignUpResponse
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `SignUpResponse`
|
||||
|
||||
```ts
|
||||
type SignUpResponse =
|
||||
| { session: null; error: ApiError }
|
||||
| { session: Session | null; error: null }
|
||||
```
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: StorageGetter
|
||||
sidebar_label: StorageGetter
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `StorageGetter`
|
||||
|
||||
```ts
|
||||
type StorageGetter = () => (
|
||||
key: string
|
||||
) => string | null | Promise<string | null>
|
||||
```
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: StorageSetter
|
||||
sidebar_label: StorageSetter
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `StorageSetter`
|
||||
|
||||
```ts
|
||||
type StorageSetter = () => (
|
||||
key: string,
|
||||
value: string | null
|
||||
) => void | Promise<void>
|
||||
```
|
||||
93
docs/docs/reference/docgen/javascript/auth/types/user.mdx
Normal file
93
docs/docs/reference/docgen/javascript/auth/types/user.mdx
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: User
|
||||
sidebar_label: User
|
||||
description: User information
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `User`
|
||||
|
||||
User information
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">id</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
User's unique identifier (uuid)
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">createdAt</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
The date-time when the user has been created
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">displayName</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
User's display name
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">avatarUrl</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
The URL to the user's profile picture
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">locale</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
The locale of the user, as a two-characters string
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
User's email address
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">isAnonymous</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Whether or not the user is anonymous
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">defaultRole</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
The default role of the user
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">roles</span>** <span className="optional-status">required</span> `Array<string>`
|
||||
|
||||
The roles assigned to the user
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">metadata</span>** <span className="optional-status">required</span> `Record<string, unknown>`
|
||||
|
||||
Additional attributes used for user information
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">emailVerified</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
Is `true` if the user email has not been verified
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> `null` | `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">phoneNumberVerified</span>** <span className="optional-status">required</span> `boolean`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">activeMfaType</span>** <span className="optional-status">required</span> `null` | `"totp"`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"label": "Nhost JS"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: createClient()
|
||||
sidebar_label: createClient()
|
||||
slug: /reference/javascript/nhost-js/create-client
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `createClient()`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">config</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>backendUrl</span> | `string` | ✔️ | Nhost backend URL. |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorage` | | |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorageType` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorageGetter</span> | `StorageGetter` | | Define a way to get information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorageSetter</span> | `StorageSetter` | | Define a way to set information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>start</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">config.</span>Client</span> | `AuthClient` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostClient
|
||||
sidebar_label: NhostClient
|
||||
description: No description provided.
|
||||
slug: /reference/javascript/nhost-js/nhost-client
|
||||
---
|
||||
|
||||
# `NhostClient`
|
||||
|
||||
Nhost Client
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostClientConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-client-constructor-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | `string` | ✔️ | Nhost backend URL. |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>Client</span> | `AuthClient` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="use autoSignIn instead">⚠️</span> | `boolean` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> | `StorageSetter` | | Define a way to set information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> | `StorageGetter` | | Define a way to get information about the refresh token and its exipration date |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorageType` | | |
|
||||
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> <span className="deprecation-sign" title="Use clientStorageGetter and clientStorageSetter options instead">⚠️</span> | `ClientStorage` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: call()
|
||||
sidebar_label: call()
|
||||
slug: /reference/javascript/nhost-js/functions/call
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `call()`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">data</span>** <span className="optional-status">required</span> `D`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> `AxiosRequestConfig<any>`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: setAccessToken()
|
||||
sidebar_label: setAccessToken()
|
||||
slug: /reference/javascript/nhost-js/functions/set-access-token
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `setAccessToken()`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `undefined` | `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostFunctionsClient
|
||||
sidebar_label: Functions
|
||||
description: No description provided.
|
||||
slug: /reference/javascript/nhost-js/functions
|
||||
---
|
||||
|
||||
# `NhostFunctionsClient`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostFunctionsConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-functions-constructor-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>url</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: request()
|
||||
sidebar_label: request()
|
||||
slug: /reference/javascript/nhost-js/graphql/request
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `request()`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">document</span>** <span className="optional-status">required</span> `string` | `DocumentNode`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">variables</span>** <span className="optional-status">optional</span> `V`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">config</span>** <span className="optional-status">optional</span> `AxiosRequestConfig<any>`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getUrl()
|
||||
sidebar_label: getUrl()
|
||||
slug: /reference/javascript/nhost-js/graphql/get-url
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `getUrl()`
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: setAccessToken()
|
||||
sidebar_label: setAccessToken()
|
||||
slug: /reference/javascript/nhost-js/graphql/set-access-token
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `setAccessToken()`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">required</span> `undefined` | `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostGraphqlClient
|
||||
sidebar_label: GraphQL
|
||||
description: No description provided.
|
||||
slug: /reference/javascript/nhost-js/graphql
|
||||
---
|
||||
|
||||
# `NhostGraphqlClient`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`NhostGraphqlConstructorParams`](/reference/docgen/javascript/nhost-js/types/nhost-graphql-constructor-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>url</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"label": "Types",
|
||||
"position": 1,
|
||||
"className": "hidden",
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"slug": "/reference/docgen/javascript/nhost-js/types"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostClientConstructorParams
|
||||
sidebar_label: NhostClientConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `NhostClientConstructorParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">backendUrl</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
Nhost backend URL.
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> `number`
|
||||
|
||||
Time interval until token refreshes, in seconds
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> `ClientStorage`
|
||||
|
||||
:::caution Deprecated
|
||||
Use clientStorageGetter and clientStorageSetter options instead
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">clientStorageType</span>** <span className="optional-status">optional</span> `ClientStorageType`
|
||||
|
||||
:::caution Deprecated
|
||||
Use clientStorageGetter and clientStorageSetter options instead
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageGetter</span>** <span className="optional-status">optional</span> `StorageGetter`
|
||||
|
||||
Define a way to get information about the refresh token and its exipration date
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">clientStorageSetter</span>** <span className="optional-status">optional</span> `StorageSetter`
|
||||
|
||||
Define a way to set information about the refresh token and its exipration date
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
When set to true, will automatically refresh token before it expires
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
:::caution Deprecated
|
||||
use autoSignIn instead
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">start</span>** <span className="optional-status">optional</span> `boolean`
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostFunctionsConstructorParams
|
||||
sidebar_label: NhostFunctionsConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `NhostFunctionsConstructorParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: NhostGraphqlConstructorParams
|
||||
sidebar_label: NhostGraphqlConstructorParams
|
||||
description: No description provided.
|
||||
displayed_sidebar: referenceSidebar
|
||||
---
|
||||
|
||||
# `NhostGraphqlConstructorParams`
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> `string`
|
||||
|
||||
---
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"label": "Storage"
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: upload()
|
||||
sidebar_label: upload()
|
||||
slug: /reference/javascript/storage/upload
|
||||
description: Use `.upload` to upload a file.
|
||||
---
|
||||
|
||||
# `upload()`
|
||||
|
||||
Use `.upload` to upload a file.
|
||||
|
||||
```ts
|
||||
storage.upload({ file })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageUploadParams`](/reference/docgen/javascript/storage/types/storage-upload-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :------------------------------------------------------------------------------------------ | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>file</span> | `File` | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>bucketId</span> | `string` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>name</span> | `string` | | |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>id</span> | `string` | | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getUrl()
|
||||
sidebar_label: getUrl()
|
||||
slug: /reference/javascript/storage/get-url
|
||||
sidebar_class_name: deprecated
|
||||
description: No description provided.
|
||||
---
|
||||
|
||||
# `getUrl()`
|
||||
|
||||
:::caution Deprecated
|
||||
use `.getPublicUrl` instead
|
||||
:::
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetUrlParams`](/reference/docgen/javascript/storage/types/storage-get-url-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getPublicUrl()
|
||||
sidebar_label: getPublicUrl()
|
||||
slug: /reference/javascript/storage/get-public-url
|
||||
description: Use `.getPublicUrl` to direct file URL to a file.
|
||||
---
|
||||
|
||||
# `getPublicUrl()`
|
||||
|
||||
Use `.getPublicUrl` to direct file URL to a file.
|
||||
|
||||
```ts
|
||||
storage.getPublicUrl({ fileId: 'uuid' })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetUrlParams`](/reference/docgen/javascript/storage/types/storage-get-url-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: getPresignedUrl()
|
||||
sidebar_label: getPresignedUrl()
|
||||
slug: /reference/javascript/storage/get-presigned-url
|
||||
description: Use `.getPresignedUrl` to get a presigned URL to a file.
|
||||
---
|
||||
|
||||
# `getPresignedUrl()`
|
||||
|
||||
Use `.getPresignedUrl` to get a presigned URL to a file.
|
||||
|
||||
```ts
|
||||
storage.getPresignedUrl({ fileId: 'uuid' })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageGetPresignedUrlParams`](/reference/docgen/javascript/storage/types/storage-get-presigned-url-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: delete()
|
||||
sidebar_label: delete()
|
||||
slug: /reference/javascript/storage/delete
|
||||
description: Use `.delete` to delete a file.
|
||||
---
|
||||
|
||||
# `delete()`
|
||||
|
||||
Use `.delete` to delete a file.
|
||||
|
||||
```ts
|
||||
storage.delete({ fileId: 'uuid' })
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`StorageDeleteParams`](/reference/docgen/javascript/storage/types/storage-delete-params)
|
||||
|
||||
| Property | Type | Required | Notes |
|
||||
| :---------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||
| <span className="parameter-name"><span className="light-grey">params.</span>fileId</span> | `string` | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||
title: setAccessToken()
|
||||
sidebar_label: setAccessToken()
|
||||
slug: /reference/javascript/storage/set-access-token
|
||||
description: Set the access token to use for authentication.
|
||||
---
|
||||
|
||||
# `setAccessToken()`
|
||||
|
||||
Set the access token to use for authentication.
|
||||
|
||||
**`@returns`**
|
||||
|
||||
Hasura Storage Client instance
|
||||
|
||||
## Parameters
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">accessToken</span>** <span className="optional-status">optional</span> `string`
|
||||
|
||||
Access token
|
||||
|
||||
---
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user