Compare commits
188 Commits
@nhost/nex
...
@nhost/nex
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
620566fa4d | ||
|
|
1a38b5dca3 | ||
|
|
e0bd8cf14b | ||
|
|
4ce8b88d27 | ||
|
|
28d25e46de | ||
|
|
e0cfcafead | ||
|
|
12bc30daa3 | ||
|
|
7b5f00d10e | ||
|
|
58e1485c13 | ||
|
|
1da0ff9109 | ||
|
|
a64f1c4396 | ||
|
|
75a1428114 | ||
|
|
d82d830849 | ||
|
|
2def59fc6c | ||
|
|
64ceb2c6bf | ||
|
|
3ee007620c | ||
|
|
c08230ae95 | ||
|
|
18df8921fd | ||
|
|
b9cf8172a0 | ||
|
|
32edfb4a9f | ||
|
|
848db9b672 | ||
|
|
3766921bcc | ||
|
|
5546052b2c | ||
|
|
c569b56d3d | ||
|
|
52ffa84adb | ||
|
|
b5ae438a8e | ||
|
|
fae05f7af2 | ||
|
|
380d7fc8ce | ||
|
|
94132bbc7f | ||
|
|
d87a9d7c79 | ||
|
|
be7756d4a2 | ||
|
|
ca5e335bff | ||
|
|
b9ed794f2b | ||
|
|
042dc7d27c | ||
|
|
db2df3d5b2 | ||
|
|
0b1cb628f2 | ||
|
|
912d95d153 | ||
|
|
76059f4738 | ||
|
|
011572f3ef | ||
|
|
b727b354dd | ||
|
|
a0682ed22e | ||
|
|
4d16306e56 | ||
|
|
b7861bbd36 | ||
|
|
e279805896 | ||
|
|
e3ebd9cb1b | ||
|
|
5bb928da2c | ||
|
|
ab06e96eac | ||
|
|
6e2aabbda0 | ||
|
|
e4ce235f38 | ||
|
|
e783b7478b | ||
|
|
06d2d2b0c7 | ||
|
|
656379e78b | ||
|
|
4156a9a61e | ||
|
|
0b72829274 | ||
|
|
6b0baab151 | ||
|
|
93f9d2d01d | ||
|
|
3fb3d4c282 | ||
|
|
ccba0b5015 | ||
|
|
62e331500d | ||
|
|
4104ddbcb6 | ||
|
|
43fc040a29 | ||
|
|
e472b2cb19 | ||
|
|
6570a940ee | ||
|
|
d3e97c87d6 | ||
|
|
36508c7930 | ||
|
|
709d364749 | ||
|
|
73eb2db159 | ||
|
|
86eb8903dc | ||
|
|
d665473074 | ||
|
|
58534c24f0 | ||
|
|
90a1c3b9e1 | ||
|
|
bdfa2b3053 | ||
|
|
2c5b31f27a | ||
|
|
d75fd747e0 | ||
|
|
a71b3aff59 | ||
|
|
13935ebdc4 | ||
|
|
f6093a619f |
@@ -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"
|
||||
]
|
||||
}
|
||||
58
README.md
58
README.md
@@ -20,7 +20,7 @@
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
**Nhost is a open-source GraphQL backend,** built with the following things in mind:
|
||||
**Nhost is an open-source GraphQL backend,** built with the following things in mind:
|
||||
|
||||
- Open-Source
|
||||
- Developer Productivity
|
||||
@@ -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,20 @@ 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"/>
|
||||
<br />
|
||||
<sub><b>Filip Hájek</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jerryjappinen">
|
||||
<img src="https://avatars.githubusercontent.com/u/1101002?v=4" width="100;" alt="jerryjappinen"/>
|
||||
@@ -227,13 +241,21 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Mustafa Hanif</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/timpratim">
|
||||
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
|
||||
<br />
|
||||
<sub><b>Pratim</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Savinvadim1312">
|
||||
<img src="https://avatars.githubusercontent.com/u/16936043?v=4" width="100;" alt="Savinvadim1312"/>
|
||||
<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"/>
|
||||
@@ -254,8 +276,7 @@ Here are some ways of contributing to making Nhost better:
|
||||
<br />
|
||||
<sub><b>Colin Broderick</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dohomi">
|
||||
<img src="https://avatars.githubusercontent.com/u/489221?v=4" width="100;" alt="dohomi"/>
|
||||
@@ -263,13 +284,21 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Dominic Garms</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/GavanWilhite">
|
||||
<img src="https://avatars.githubusercontent.com/u/2085119?v=4" width="100;" alt="GavanWilhite"/>
|
||||
<br />
|
||||
<sub><b>Gavan Wilhite</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/alveshelio">
|
||||
<img src="https://avatars.githubusercontent.com/u/8176422?v=4" width="100;" alt="alveshelio"/>
|
||||
<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"/>
|
||||
@@ -277,6 +306,13 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Hoang Do</b></sub>
|
||||
</a>
|
||||
</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"/>
|
||||
@@ -284,21 +320,13 @@ Here are some ways of contributing to making Nhost better:
|
||||
<sub><b>Nirmalya Ghosh</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/timpratim">
|
||||
<img src="https://avatars.githubusercontent.com/u/32492961?v=4" width="100;" alt="timpratim"/>
|
||||
<br />
|
||||
<sub><b>Pratim</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/quentin-decre">
|
||||
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
|
||||
<br />
|
||||
<sub><b>Quentin Decré</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/komninoschat">
|
||||
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>
|
||||
|
||||
@@ -24,7 +24,7 @@ $ pnpm build
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
### Serve
|
||||
### Serve
|
||||
|
||||
```bash
|
||||
$ pnpm serve
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
title: 'Metadata and Serverless Functions'
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
In the previous section, we only created a new table; `customers`. Using the CLI you can also do changes to other parts of your backend.
|
||||
|
||||
There are three things the CLI and the GitHub integration track and applies to production:
|
||||
@@ -73,20 +76,25 @@ Serverless functions are placed in the `functions/` folder of your repository. E
|
||||
|
||||
Before we create our serverless function we'll install `express`, which is a requirement for serverless functions to work.
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="npm" label="npm" default>
|
||||
|
||||
```bash
|
||||
npm install express
|
||||
# or with yarn
|
||||
yarn add express
|
||||
npm install -d @types/node @types/express
|
||||
```
|
||||
|
||||
We'll use TypeScript so we'll install two type definitions too:
|
||||
</TabItem>
|
||||
<TabItem value="yarn" label="Yarn">
|
||||
|
||||
```bash
|
||||
npm install -d @types/node @types/express
|
||||
# or with yarn
|
||||
yarn add express
|
||||
yarn add -D @types/node @types/express
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
Then we'll create a file `functions/time.ts`
|
||||
|
||||
In the file `time.ts` we'll add the following code to create our serverless function:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: 'Create your app'
|
||||
slug: /get-started/quick-start
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
title: 'JavaScript client'
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
In the previous section, you used the Hasura Console to fetch a list of todos. Now, you will write a small JavaScript client to interact and retrieve todos from your Nhost app.
|
||||
|
||||
### Frontend frameworks
|
||||
@@ -14,40 +17,36 @@ In this guide, we'll keep the example simple. We're not using a frontend framewo
|
||||
|
||||
## Setup
|
||||
|
||||
> Make sure you have [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/getting-started) installed.
|
||||
:::info
|
||||
|
||||
Create a new folder called `nhost-todos`, and initialize a new JavaScript app there:
|
||||
Make sure you have [Node.js](https://nodejs.org) and [npm](https://docs.npmjs.com/getting-started) or [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) installed.
|
||||
|
||||
Using npm package manager
|
||||
:::
|
||||
|
||||
Create a new folder called `nhost-todos`, initialize a new JavaScript app there, and install the Nhost JavaScript SDK:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="npm" label="npm" default>
|
||||
|
||||
```bash
|
||||
npm init -y
|
||||
yarn add @nhost/nhost-js graphql
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
Using Yarn package manager
|
||||
</TabItem>
|
||||
<TabItem value="yarn" label="Yarn">
|
||||
|
||||
```bash
|
||||
yarn init -y
|
||||
npm install @nhost/nhost-js graphql
|
||||
```
|
||||
|
||||
> You might have to edit the `package.json` file and add/change the `type` object to `module` (`"type": "module"`).
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
Install Nhost JavaScript SDK:
|
||||
|
||||
Using npm package manager
|
||||
|
||||
```bash
|
||||
npm install @nhost/nhost-js
|
||||
```
|
||||
|
||||
or
|
||||
Using Yarn package manager
|
||||
|
||||
```bash
|
||||
yarn add @nhost/nhost-js
|
||||
```
|
||||
:::caution attention
|
||||
You might have to edit the `package.json` file and add/change the `type` object to `module` (`"type": "module"`).
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: 'Set permissions'
|
||||
---
|
||||
|
||||
In the previous section, you could fetch the todos because the **admin** role is enabled by default when using Hasura Console. When building your applications, you want to define permissions using **roles** that your users can assume when making requests.
|
||||
While using the Hasura Console, you could fetch the todos because the **admin** role is enabled by default but when building your applications with a client, you want to define permissions using **roles** that your users can assume when making requests.
|
||||
|
||||
Hasura supports role-based access control. You create rules for each role, table, and operation (select, insert, update and delete) that can check dynamic session variables, like user ID.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ cd my-nhost-v2-app
|
||||
|
||||
### Update config
|
||||
|
||||
Update `config: 3` to `config: 2` in `nhost/config.yaml`. This will update Hasura's configuration version, and we need to downgrade the version when we export migrations and metadata.
|
||||
Update `version: 3` to `version: 2` in `nhost/config.yaml`. This will update Hasura's configuration version, and we need to downgrade the version when we export migrations and metadata.
|
||||
|
||||
### Export current migrations and metadata from Nhost v1
|
||||
|
||||
@@ -88,15 +88,17 @@ Update `config: 2` to `config: 3` in `nhost/config.yaml`.
|
||||
|
||||
### Pull migrations and metadata from our local instance
|
||||
|
||||
:::tip
|
||||
You can not use port `1337` in these requests. You have to use the specific port Huasra uses. Go to the Hasura Console under API and look what port Hasura is using under GraphQL Endpoint.
|
||||
:::
|
||||
In the `nhost/` folder, run the following command:
|
||||
|
||||
```bash
|
||||
hasura migrate create init --from-server --endpoint=http://localhost:[hasura-port] --admin-secret=nhost-admin-secret
|
||||
hasura metadata export --from-server --endpoint=http://localhost:[hasura-port] --admin-secret=nhost-admin-secret
|
||||
hasura metadata export --endpoint=http://localhost:[hasura-port] --admin-secret=nhost-admin-secret
|
||||
```
|
||||
|
||||
:::warning
|
||||
You cannot use port `1337` in the commands above. You have to use the specific port Hasura uses. Go to the Hasura Console under API and look for the port Hasura is using under GraphQL Endpoint.
|
||||
:::
|
||||
|
||||
### Done
|
||||
|
||||
You now have a Nhost v2 project locally with correct migrations and metadata. Happy hacking!
|
||||
|
||||
5
docs/docs/platform/_category_.json
Normal file
5
docs/docs/platform/_category_.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"label": "The Nhost Platform",
|
||||
"position": 1,
|
||||
"link": { "type": "generated-index", "slug": "/platform" }
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"label": "Authentication",
|
||||
"position": 3,
|
||||
"position": 4,
|
||||
"link": { "id": "platform/authentication/index", "type": "doc" }
|
||||
}
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -79,7 +79,7 @@ await nhost.auth.signIn({
|
||||
|
||||
A user can be created anonymously. This is useful for offering a limited version of your application to your users without having them sign in first.
|
||||
|
||||
An anonymous user gets a user ID with the `anonymous` role. This role can be used to [set permissions in Hasura](/platform/database/permissions).
|
||||
An anonymous user gets a user ID with the `anonymous` role. This role can be used to [set permissions in Hasura](/platform/graphql/permissions).
|
||||
|
||||
### Deanonymize users
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"label": "Database",
|
||||
"position": 2,
|
||||
"collapsed": false,
|
||||
"link": { "type": "generated-index", "slug": "/platform/database" }
|
||||
"position": 2
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Schema'
|
||||
title: 'Database'
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
4
docs/docs/platform/graphql/_category_.json
Normal file
4
docs/docs/platform/graphql/_category_.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "GraphQL",
|
||||
"position": 3
|
||||
}
|
||||
@@ -1,31 +1,49 @@
|
||||
---
|
||||
title: 'GraphQL'
|
||||
sidebar_position: 3
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
GraphQL is a query language for APIs. It provides a complete and understandable description of the data in your API.
|
||||
Every Nhost app has its own autogenerated GraphQL API. The GraphQL API is based on the tables and columns in the [Postgres database](/platform/database) and is instantly available. It's [Hasura GraphQL engine](https://github.com/hasura/graphql-engine) that powers the GraphQL API.
|
||||
|
||||
Every Nhost app comes with a GraphQL API, and you can connect to this API with any GraphQL client you like. Most often you'd use the client included in [Nhost SDK](/reference/sdk/graphql).
|
||||
The GraphQL API is available at: `https://[subdomain].nhost.run/v1/graphql`.
|
||||
|
||||
## What is GraphQL
|
||||
|
||||
GraphQL is a query language for APIs that prioritize developer experience. The GraphQL API can be used to both fetch (query) and modify (mutation) data. GraphQL is especially powerful for frontend developers who wants to build products fast.
|
||||
|
||||
### GraphQL clients for JavaScript
|
||||
|
||||
To interact with the GraphQL API it's recommended to use a GraphQL client:
|
||||
|
||||
- [Apollo Client](https://www.apollographql.com/docs/react/)
|
||||
- [URQL](https://formidable.com/open-source/urql/)
|
||||
- [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/javascript/nhost-js/graphql) in the Nhost JavaScript client.
|
||||
|
||||
---
|
||||
|
||||
## GraphQL queries
|
||||
## GraphQL Query
|
||||
|
||||
You can read your app's data with a GraphQL query.
|
||||
A GraphQL query is used to fetch data from the database.
|
||||
|
||||
Here is a GraphQL query that selects title, body, and done for every row in your todos table.
|
||||
Here is a GraphQL query that selects `title`, `body`, and `isCompleted` for every row in a `todos` table.
|
||||
|
||||
**Example:**
|
||||
|
||||
```graphql
|
||||
query GetTodos {
|
||||
todos {
|
||||
title
|
||||
body
|
||||
done
|
||||
isCompleted
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Response:
|
||||
**Response:**
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -33,7 +51,7 @@ Response:
|
||||
"todos": [
|
||||
{
|
||||
"title": "Delete Firebase account",
|
||||
"body": "Migrate to nhost.io",
|
||||
"body": "Migrate to Nhost",
|
||||
"isCompleted": true
|
||||
}
|
||||
]
|
||||
@@ -43,7 +61,7 @@ Response:
|
||||
|
||||
#### Filtering and sorting
|
||||
|
||||
More complex queries utilize filters, limits, sorting and aggregation.
|
||||
GraphQL queries More complex queries utilize filters, limits, sorting and aggregation.
|
||||
|
||||
This GraphQL query selects all items in the todo table that aren't done, with the total number of comments and the last five comments:
|
||||
|
||||
@@ -98,6 +116,12 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
:::tip
|
||||
Check out Hasura's documentation for full documentation for GraphQL queries.
|
||||
|
||||
[Hasura GraphQL queries](https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/index/)
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## GraphQL mutations
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 'Permissions'
|
||||
sidebar_position: 2
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
The GraphQL API is protected by a role-based permission system based on access tokens. Permissions are handled on a per-table basis in Hasura Console.
|
||||
@@ -1,35 +1,11 @@
|
||||
---
|
||||
title: 'The Nhost platform'
|
||||
title: 'The Nhost Platform'
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
This section:
|
||||
|
||||
### Database
|
||||
|
||||
- [Schema](/platform/database)
|
||||
- [Permissions](/platform/database/permissions)
|
||||
- [GraphQL](/platform/database/graphql)
|
||||
|
||||
### Authentication
|
||||
|
||||
- [Authentication overview](/platform/authentication)
|
||||
- [User management](/platform/authentication/user-management)
|
||||
- [Sign-in methods](/platform/authentication/sign-in-methods)
|
||||
- [OAuth providers](/platform/authentication/social-sign-in)
|
||||
- [Email templates](/platform/authentication/email-templates)
|
||||
|
||||
### Storage
|
||||
|
||||
- [File storage](/platform/storage)
|
||||
|
||||
### Serverless functions
|
||||
|
||||
- [Creating functions](/platform/serverless-functions)
|
||||
- [Event triggers](/platform/serverless-functions/event-triggers)
|
||||
|
||||
### Nhost
|
||||
|
||||
- [Environment variables](/platform/nhost/environment-variables)
|
||||
- [GitHub integration](/platform/nhost/github-integration)
|
||||
- [Local development](/platform/nhost/local-development)
|
||||
- [Database](/platform/database)
|
||||
- [GraphQL](/platform/graphql)
|
||||
- [Authentication](/platform/authentication)
|
||||
- [Storage](/platform/storage)
|
||||
- [Serverless Functions](/platform/serverless-functions)
|
||||
- [Nhost](/platform/nhost)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"label": "Nhost",
|
||||
"position": 6
|
||||
"position": 7
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ title: 'Nhost CLI'
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Nhost CLI lets you run Nhost's development environment locally on macOS, Linux and Windows.
|
||||
|
||||
---
|
||||
@@ -28,10 +31,23 @@ To run serverless functions locally, you must have the appropriate runtimes inst
|
||||
|
||||
For Node.js, you will also need to have [express](https://www.npmjs.com/package/express) installed in your repository:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="npm" label="npm" default>
|
||||
|
||||
```bash
|
||||
npm install --save-dev express @types/express
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="yarn" label="Yarn">
|
||||
|
||||
```bash
|
||||
yarn add -D express @types/express
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
[Read more about runtimes](/platform/serverless-functions)
|
||||
|
||||
---
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"label": "Serverless Functions",
|
||||
"position": 5,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"slug": "/platform/serverless-functions"
|
||||
}
|
||||
"position": 6
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Creating functions'
|
||||
title: 'Serverless Functions'
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
@@ -39,19 +39,19 @@ HTTP endpoints are automatically generated based on the file structure under `fu
|
||||
|
||||
As such, given this file structure:
|
||||
|
||||
```js
|
||||
functions / index.js;
|
||||
functions / users / index.ts;
|
||||
functions / active.ts;
|
||||
functions / my - company.js;
|
||||
```text
|
||||
functions/index.js
|
||||
functions/users/index.ts
|
||||
functions/active.ts
|
||||
functions/my-company.js
|
||||
```
|
||||
|
||||
The following endpoints will be available:
|
||||
|
||||
- https://yourappid.nhost.run/v1/functions/ - (functions/index.js)
|
||||
- https://yourappid.nhost.run/v1/functions/users - (functions/users/index.ts)
|
||||
- https://yourappid.nhost.run/v1/functions/users/active - (functions/users/active.ts)
|
||||
- https://yourappid.nhost.run/v1/functions/my-company - (functions/my-company.js)
|
||||
- https://yourappid.nhost.run/v1/functions/ from `functions/index.js`.
|
||||
- https://yourappid.nhost.run/v1/functions/users from `functions/users/index.ts`.
|
||||
- https://yourappid.nhost.run/v1/functions/users/active from `functions/users/active.ts`.
|
||||
- https://yourappid.nhost.run/v1/functions/my-company from `functions/my-company.js`.
|
||||
|
||||
If you've used Netlify or Vercel, this routing logic will be familiar to you.
|
||||
|
||||
@@ -59,6 +59,4 @@ If you've used Netlify or Vercel, this routing logic will be familiar to you.
|
||||
|
||||
## Infrastructure
|
||||
|
||||
In production, serverless functions are deployed on AWS Lambda.
|
||||
|
||||
When developing locally, you must have the correct runtime installed on your machine.
|
||||
Serverless Functions are deployed to AWS Lambda in the same region as your app.
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"label": "Storage",
|
||||
"position": 4,
|
||||
"link": { "type": "generated-index", "slug": "/platform/storage" }
|
||||
"position": 5
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: 'File storage'
|
||||
sidebar_position: 1
|
||||
title: 'Storage'
|
||||
---
|
||||
|
||||
Nhost stores and serves files of any type in your backend.
|
||||
@@ -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"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user