Compare commits

...

70 Commits

Author SHA1 Message Date
Pilou
6777738c53 Merge pull request #519 from nhost/changeset-release/main
chore: update versions
2022-05-06 15:24:04 +02:00
github-actions[bot]
0d60693c27 chore: update versions 2022-05-06 11:43:21 +00:00
Pilou
c159c9c98c Merge pull request #518 from nhost/fix/refresh-token-load
fix: corrections and reshape the react-apollo example
2022-05-06 13:42:05 +02:00
Pierre-Louis Mercereau
58fa2a201c fix: corrections and reshape the react-apollo example 2022-05-06 12:55:17 +02:00
Johan Eliasson
db4607ccac Merge pull request #516 from nhost/docs-guides
Docs intro of Nhost
2022-05-06 11:50:05 +02:00
Johan Eliasson
95b14557a0 intro 2022-05-06 11:47:29 +02:00
Johan Eliasson
8b527d0fcb Merge pull request #445 from nhost/docs-guides
docs: intro, architecture and quickstarts
2022-05-06 11:43:41 +02:00
Pilou
fc50beec5e Merge pull request #513 from nhost/docs/clean-nextjs-intro
remove reference to useless component
2022-05-06 10:42:24 +02:00
Pierre-Louis Mercereau
ed0de2d930 remove reference to useless component 2022-05-05 21:53:37 +02:00
Pilou
f26e8c3614 Merge pull request #491 from nhost/changeset-release/main
chore: update versions
2022-05-05 16:11:42 +02:00
Pierre-Louis Mercereau
a05a484426 chore: correct changelog 2022-05-05 16:04:33 +02:00
Pierre-Louis Mercereau
4f0d5aa9c0 chore: downgrade major to minor bump 2022-05-05 16:02:23 +02:00
github-actions[bot]
254e362e95 chore: update versions 2022-05-05 13:58:01 +00:00
Pilou
a2a8839694 Merge pull request #507 from nhost/refactor/simplify-and-correct-options
Make code more consistent, implement the 'custom and 'cookie' storage types
2022-05-05 15:56:41 +02:00
Pierre-Louis Mercereau
d12667ccc5 refactor: post-review 2022-05-05 15:22:35 +02:00
Pierre-Louis Mercereau
feb55fe0ad chore: update lockfile 2022-05-05 14:43:12 +02:00
Pilou
b97c0a9c9d Merge branch 'main' into refactor/simplify-and-correct-options 2022-05-05 14:35:08 +02:00
Pierre-Louis Mercereau
2e98934f75 refactor: expose the interface of NhostReactProvider and use PropsWithChildren type 2022-05-05 13:35:30 +02:00
Pilou
8cedafc807 Merge pull request #503 from nhost/patch/react-18
Patch/react 18
2022-05-05 13:27:24 +02:00
Pierre-Louis Mercereau
322b433994 docs(example): correct nextjs example 2022-05-05 12:07:20 +02:00
Pierre-Louis Mercereau
6082ba6943 docs: remove part of the doc already automatically generated 2022-05-05 10:54:24 +02:00
Pierre-Louis Mercereau
1fb1d25a72 chore: remove testing credentials 2022-05-05 10:39:07 +02:00
Pierre-Louis Mercereau
ae4e4e50f6 chore: update changeset 2022-05-05 10:37:22 +02:00
Pierre-Louis Mercereau
185f39e23f fix: don't take previous errors into account when using SMS and deanonymisation 2022-05-05 10:35:49 +02:00
Pierre-Louis Mercereau
0dd7cab3bf fix: remove async import 2022-05-04 22:35:18 +02:00
Pierre-Louis Mercereau
47c7380d89 refactor: cooooooooookies
(miom miom miom)
2022-05-04 22:28:13 +02:00
Pierre-Louis Mercereau
b56162a74b refactor: make code more consistent, and implement the 'custom and 'cookie' client storage types 2022-05-04 22:25:17 +02:00
Pierre-Louis Mercereau
aeb8b8afda chore: lint, and update changesets 2022-05-04 14:23:58 +02:00
Pierre-Louis Mercereau
f9e107b008 docs: return errors to the UI 2022-05-04 13:42:30 +02:00
Pierre-Louis Mercereau
d748d82483 docs: flesh up the nextjs example 2022-05-04 13:11:00 +02:00
Johan Eliasson
2192fdc92e change cta 2022-05-04 09:04:53 +02:00
Johan Eliasson
eec2601a3a architecture 2022-05-04 08:55:17 +02:00
Johan Eliasson
93eaa85b47 Merge branch 'main' into docs-guides 2022-05-04 07:40:53 +02:00
Pierre-Louis Mercereau
4c8a168c02 refactor: update lockfile 2022-05-03 22:12:57 +02:00
Pierre-Louis Mercereau
eb166cf5ee refactor: remove debug code 2022-05-03 22:07:07 +02:00
Pierre-Louis Mercereau
54e1873461 refactor: wrap again the apollo client creation into useEffect to avoid SSR when CSR 2022-05-03 22:02:15 +02:00
Pierre-Louis Mercereau
e5bc3b356c refactor(nextjs): bump to React 18 and Apollo client 3.6.2 2022-05-03 21:43:39 +02:00
Pierre-Louis Mercereau
42edb74057 refactor: upgrade to React 18 2022-05-03 21:20:10 +02:00
Pierre-Louis Mercereau
3ebeae9294 refactor: upgrade react-apollo to React 18 to reproduce the missing attached headers bug 2022-05-03 19:51:50 +02:00
Pilou
24189bd155 Merge pull request #501 from nhost/contributors-readme-action-tjRSlp2hVR
contributors readme action update
2022-05-03 16:47:01 +02:00
github-actions[bot]
5985b18764 contrib-readme-action has updated readme 2022-05-03 14:43:47 +00:00
Pilou
95efcb4de6 Merge pull request #500 from heygambo/patch-1
Adds environment variables to auth service
2022-05-03 16:43:30 +02:00
Christian Gambardella
609d9001f5 Adds environment variables to auth service
I ran into an issue where I couldn't sign up users because the auth service wasn't able to connect to mailhog.
That caused the auth service to not send an email and not respond to the HTTP request.

fixes #499 

I'm wondering if anyone else had this issue. If I'm the only one then maybe this PR is obsolete.
2022-05-03 16:18:36 +02:00
Pilou
1e44a14b8a Merge pull request #497 from nhost/docs/generate-hasura-auth-openapi
Generate the latest hasura-auth openapi specs
2022-05-02 17:05:26 +02:00
Pierre-Louis Mercereau
5917eff5a6 chore: newline 2022-05-02 09:44:38 +02:00
Pierre-Louis Mercereau
f8ee87ad01 feat: smalls script that generates the latest hasura-auth openapi specs 2022-05-02 09:42:24 +02:00
Szilárd Dóró
a7990b363f Merge pull request #496 from nhost/contributors-readme-action-Vits42iSrd
contributors readme action update
2022-05-02 08:59:28 +02:00
github-actions[bot]
ca8ecb4b5c contrib-readme-action has updated readme 2022-05-02 06:48:04 +00:00
Szilárd Dóró
dfe080b8f6 Merge pull request #495 from GavanWilhite/patch-2
Fixed npm <> yarn instructions
2022-05-02 08:47:50 +02:00
Gavan Wilhite
069a5d4d9a Fixed npm <> yarn instructions 2022-05-01 19:42:53 -06:00
Pilou
efccd54641 Merge pull request #492 from nhost/docs/autogen-edit-page
feat: link the 'Edit Page' button to the source code instead of the generated file
2022-04-29 17:02:18 +02:00
Pilou
a3357265ec Merge pull request #480 from nhost/docs/algolia
docs: enable algolia search
2022-04-29 12:33:20 +02:00
Pierre-Louis Mercereau
494d8127dc refactor: simplify 2022-04-29 12:31:15 +02:00
Pierre-Louis Mercereau
57b628a255 refactor: remove useless condition 2022-04-29 12:28:31 +02:00
Pierre-Louis Mercereau
98b30a5c5e Merge branch 'main' into docs/autogen-edit-page 2022-04-29 12:26:02 +02:00
Pierre-Louis Mercereau
48afcf415d feat: link the 'Edit Page' button to the source code instead of the generated file 2022-04-29 12:24:33 +02:00
Johan Eliasson
58b9488af8 update setting 2022-04-29 11:48:42 +02:00
Pilou
e49528d43e Merge pull request #488 from nhost/chore/rename-user-hooks
fix: rename user data hooks to make them all start with `userUser...`
2022-04-29 11:47:33 +02:00
Pilou
ab0f5582e5 Merge pull request #489 from nhost/docs/developers-guide
Basic developer guide
2022-04-29 11:47:17 +02:00
Pierre-Louis Mercereau
b499548503 post review 2022-04-29 10:30:29 +02:00
Pilou
fbc15cfee1 Merge pull request #452 from nhost/441-user_id-not-seen-in-the-screenshots-before-the-permissions-section-of-todoapp
docs: correct docs for `user_id` column
2022-04-29 09:43:03 +02:00
Pierre-Louis Mercereau
8788de83e8 docs: basic developer guide 2022-04-29 09:14:41 +02:00
Pierre-Louis Mercereau
1fb51a7bed fix: rename user data hooks to make them all start with userUser... 2022-04-29 08:31:32 +02:00
Pierre-Louis Mercereau
56b1adfa81 docs: enable algolia search 2022-04-27 17:25:34 +02:00
Johan Eliasson
65d61cf4b8 update 2022-04-25 09:40:23 +02:00
Johan Eliasson
a8d5214b2f grammerly updates 2022-04-25 09:39:14 +02:00
Johan Eliasson
f9e5283fc3 correct docs for column 2022-04-25 09:35:18 +02:00
Johan Eliasson
5a212aaa12 link fix 2022-04-22 22:34:45 +02:00
Johan Eliasson
79056d8b48 update 2022-04-22 22:30:02 +02:00
Johan Eliasson
f86883df88 new menu strucutre 2022-04-22 22:20:42 +02:00
334 changed files with 7022 additions and 2864 deletions

View File

@@ -24,6 +24,8 @@ If you find an Issue that addresses the problem you're having, please add your r
### Pull Requests
Please have a look at our [developers guide](https://github.com/nhost/nhost/blob/main/DEVELOPERS.md) to start coding!
PRs to our libraries are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should:
- Only fix/add the functionality in question **OR** address wide-spread whitespace/style issues, not both.

79
DEVELOPERS.md Normal file
View File

@@ -0,0 +1,79 @@
# Developer guide
## Requirements
- We use [pnpm](https://pnpm.io/) as a package manager to fasten development and builds, and as a backbone to our monorepo. You have to make sure it is installed in your machine. There are [multiple ways to install it](https://pnpm.io/installation), but the easiest way is with `npm`:
```sh
npm install -g pnpm
```
- Our tests and examples are using the Nhost CLI to run the backend services locally. You can follow the instructions to install it in [our documentation](https://docs.nhost.io/get-started/cli-workflow/install-cli)
## Getting things ready
First, clone this repository:
```sh
git clone https://github.com/nhost/nhost
```
Then, install the dependencies with `pnpm`:
```sh
cd nhost
pnpm install
```
## Starting development from an example
Let's follow the instructions to start [react-apollo example](https://github.com/nhost/nhost/blob/main/examples/react-apollo/README.md).
## Running the documentation website locally
The easier way to contribute to our documentation is to move to the `docs` folder and follow the [instructions to start local development](https://github.com/nhost/nhost/blob/main/docs/README.md):
```sh
cd docs
# not necessary step if you've done this step already anywhere in the repository
pnpm install
pnpm start
```
## Testing
In order to run tests, the Nhost testing backend should run locally. You can start it in from a separate terminal:
```sh
cd examples/testing-project
nhost -d
```
Once Nhost started locally, you can run the tests from the root folder of the repository with the following command:
```sh
pnpm test
```
## Changesets
If you made some changes in the packages, you will have to describe these changes so they will be taken into account in the next release.
We are using [changesets](https://github.com/changesets/changesets) to support our version/publish workflows. When submitting a pull request, a bot will check if some changesets are present, and if not, will guide you to add them.
The most comprehensive way to add a changeset is to run the following command from the root directory of the repository:
```sh
pnpm changeset
```
This will generate a file in the `.changeset` directory. You can edit it to give further details about the change you just made.
You can have a look at the changesets documentation on [how to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
## Commiting changes
You may notice `git commit` takes a few seconds to run. We set a commit hook that scan the changes in the code, automatically generates the documentation from the inline [TSDoc](https://tsdoc.org/) annotations, and add these generated documentation files to the commit. They will automatically update the [reference documentation](https://docs.nhost.io/reference).
<!-- ## Good practices
- lint
- prettier
- documentation -->

View File

@@ -120,7 +120,7 @@ Here are some ways of contributing to making Nhost better:
- **[Try out Nhost](https://docs.nhost.io/get-started/quick-start)**, and think of ways to make the service better. Let us know here on GitHub.
- Join our [Discord](https://discord.com/invite/9V7Qb2U) and connect with other members to share and learn from.
- Send a pull request to any of our [open source repositories](https://github.com/nhost) on Github. Check our [contribution guide](https://github.com/nhost/nhost/blob/main/CONTRIBUTING.md) for more details about how to contribute. We're looking forward to your contribution!
- Send a pull request to any of our [open source repositories](https://github.com/nhost) on Github. Check our [contribution guide](https://github.com/nhost/nhost/blob/main/CONTRIBUTING.md) and our [developers guide](https://github.com/nhost/nhost/blob/main/DEVELOPERS.md) for more details about how to contribute. We're looking forward to your contribution!
### Contributors
@@ -227,6 +227,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Filip Hájek</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/jerryjappinen">
<img src="https://avatars.githubusercontent.com/u/1101002?v=4" width="100;" alt="jerryjappinen"/>
@@ -247,15 +254,15 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Pratim</b></sub>
</a>
</td>
</td></tr>
<tr>
<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></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/ahmic">
<img src="https://avatars.githubusercontent.com/u/13452362?v=4" width="100;" alt="ahmic"/>
@@ -270,6 +277,13 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Anders Kjær Damgaard</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/heygambo">
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
<br />
<sub><b>Christian Gambardella</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/rustyb">
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
@@ -283,22 +297,15 @@ Here are some ways of contributing to making Nhost better:
<br />
<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></tr>
<tr>
<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></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/nkhdo">
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>

View File

@@ -3,7 +3,7 @@ title: 'Authenticate users'
slug: /get-started/authentication
---
You defined `select` permissions for the `public` role in the previous section. You will now add `insert` and `create` permissions for authenticated users to secure your app's GraphQL API with authentication.
In the previous section, you defined `select` permissions for the `public` role. You will now add `insert` and `select` permissions for authenticated users to secure your app's GraphQL API with authentication.
> Nhost's authentication service lets you deliver frictionless registration and login experiences to your users. We support most social providers and different methods such as email & password and passwordless (magic link).
@@ -13,13 +13,15 @@ You defined `select` permissions for the `public` role in the previous section.
Manually create a user by going to your app's **Users** tab (top menu) and clicking on **Add User**.
![Add user](/img/quick-start/add-user.gif)
<video width="99%" loop="" muted="" playsInline="" controls="true">
<source src="/videos/add-user.mp4" type="video/mp4" />
</video>
You will now use that newly created user to make authenticated requests to the API.
You will now use that newly created user. We'll use this newly created user to make authenticated requests to the GraphQL API.
---
## Authenticate and query data
## Sign in and query data
Add the following code to sign in the new user and request the list of todos again:
@@ -60,9 +62,41 @@ Why is the return value `null`? Because when making GraphQL requests as an authe
> For authenticated requests, there is always the option to override the default `user` role with any other valid role.
---
To prepare our database and GraphQL API to work for signed-in users we need to do two things:
## Permissions for users
1. Add a `user_id` column to the `todos` table, so we know what todo belongs to which user.
2. Use the `user` role instead of the `public` role for permissions.
## Add `user_id` column
Before adding the `user_id` column, let's delete all existing todos.
Then add the `user_id` column as a `UUID` type. Make sure that `nullable` is **not** checked. This will ensure that all todos must have a `user_id` value.
At last, we'll create a connection between the `todos` table and the `users` table. For that, we need to do yet another two things:
1. Create a Foreign Key (FK) between `todos` and `auth.users.id`.
2. Let Hasura track the relationship between the two tables.
<video width="99%" loop="" muted="" playsInline="" controls="true">
<source src="/videos/user-id-column.mp4" type="video/mp4" />
</video>
### Create FK
Create a FK between the `auth.users.id` column and the `public.todos.user_id` column. See video above.
### Track relationship
Click on the `public` schema and track the untracked foreign key relationship. Then click on the `auth` schema and track the relationship again. See video above.
We track these relationships to create the GrpahQL relationships between the `todos` table to the `users` table and the `users` table to the `todos` table.
Ok, our `user_id` column is added and connected correctly. Let's continue with setting permissions for signed-in users.
## Permissions for signed-in users
Let us organize the permissions so it works for signed in users too.
### Remove permissions for the public role
@@ -72,7 +106,7 @@ We won't use the `public` role anymore, so let's remove all permission for that
Now we'll add permissions for the `user` role.
> All logged-in users have the `user` role.
> Signed-in users use the `user` role by default
### Insert permission

View File

@@ -30,7 +30,7 @@ Create a new folder called `nhost-todos`, initialize a new JavaScript app there,
```bash
npm init -y
yarn add @nhost/nhost-js graphql
npm install @nhost/nhost-js graphql
```
</TabItem>
@@ -38,7 +38,7 @@ yarn add @nhost/nhost-js graphql
```bash
yarn init -y
npm install @nhost/nhost-js graphql
yarn add @nhost/nhost-js graphql
```
</TabItem>

View File

@@ -65,7 +65,9 @@ This is all we need! A new table will be created when you click **Add Table**.
Go to the **Insert Row** tab to add some data to your database.
![Inserting todos](/img/quick-start/insert-todos.gif)
<video width="99%" loop="" muted="" playsInline="" controls="true">
<source src="/videos/insert-todos.mp4" type="video/mp4" />
</video>
---

View File

@@ -1,5 +0,0 @@
{
"label": "The Nhost Platform",
"position": 1,
"link": { "type": "generated-index", "slug": "/platform" }
}

View File

@@ -1,5 +1,4 @@
{
"label": "Authentication",
"position": 4,
"link": { "id": "platform/authentication/index", "type": "doc" }
"position": 6
}

View File

@@ -1,6 +1,6 @@
---
title: 'Nhost CLI'
sidebar_position: 3
title: 'CLI'
sidebar_position: 11
---
import Tabs from '@theme/Tabs';

View File

@@ -1,4 +1,4 @@
{
"label": "Database",
"position": 2
"position": 4
}

View File

@@ -1,6 +1,6 @@
---
title: 'Environment variables'
sidebar_position: 1
sidebar_position: 9
---
Environment variables are key-value pairs configured outside your source code. They are used to store environment-specific values such as API keys.

View File

@@ -1,6 +1,6 @@
---
title: 'GitHub integration'
sidebar_position: 2
sidebar_position: 10
---
You can connect your Nhost app to a GitHub repository. When you do this, any updates you push to your code will automatically be deployed.
@@ -21,7 +21,7 @@ Specifically, the following will be deployed:
## Workflow
Create a new Nhost app. Then use [Nhost CLI](/platform/nhost/local-development) to initialize your Nhost app locally.
Create a new Nhost app. Then use [Nhost CLI](/platform/cli) to initialize your Nhost app locally.
The workflow is as follows:

View File

@@ -1,4 +1,4 @@
{
"label": "GraphQL",
"position": 3
"position": 5
}

View File

@@ -1,11 +0,0 @@
---
title: 'The Nhost Platform'
sidebar_position: 1
---
- [Database](/platform/database)
- [GraphQL](/platform/graphql)
- [Authentication](/platform/authentication)
- [Storage](/platform/storage)
- [Serverless Functions](/platform/serverless-functions)
- [Nhost](/platform/nhost)

View File

@@ -0,0 +1,28 @@
---
title: 'Introduction to Nhost'
sidebar_label: Introduction
sidebar_position: 1
---
Nhost is the open source GraphQL backend (Firebase Alternative) and a development platform. Nhost is doing for the backend, what [Netlify](https://netlify.com/) and [Vercel](https://vercel.com/) are doing for the frontend.
We provide a modern backend with the general building blocks required to build fantastic digital products.
We make it easy to build and deploy this backend using our platform that takes care of configuration, security, and performance. Things just works and scale automatically so you can focus on your product and on your business.
## Quickstart
Get started quickly by following one of our quickstart guides:
- [Next.js](/platform/quickstarts/nextjs)
- [React](/platform/quickstarts/react)
## Products and features
Learn more about the product and features of Nhost.
- [Database](/platform/database)
- [GraphQL](/platform/graphql)
- [Authentication](/platform/authentication)
- [Storage](/platform/storage)
- [Serverless Functions](/platform/serverless-functions)

View File

@@ -1,4 +0,0 @@
{
"label": "Nhost",
"position": 7
}

View File

@@ -1,9 +0,0 @@
---
title: 'Overview'
---
Documentation for other platform features:
- [Environment variables](/platform/nhost/environment-variables)
- [GitHub integration](/platform/nhost/github-integration)
- [Local development](/platform/nhost/local-development)

View File

@@ -0,0 +1,5 @@
{
"label": "Overview",
"position": 2,
"collapsed": false
}

View File

@@ -0,0 +1,30 @@
---
title: 'Architecture'
sidebar_position: 2
---
Nhost is a backend as a service built with open source tools to provide developers the general building blocks required to build fantastic digital apps and products.
Here's a diagram of the Nhost stack on a high level:
![Nhost Architecture Diagram](/img/architecture/nhost-diagram.png)
As you see in the image above, Nhost provides endpoints for:
- GraphQL (`/graphql`)
- Authentication (`/auth`)
- Storage (`/storage`)
- Functions (`/functions`)
Data is stored in Postgres and files are stored in S3.
## Open Source
The open source tools used for the full Nhost stack are:
- Database: [Postgres](https://www.postgresql.org/)
- S3: [Minio](https://github.com/minio/minio)
- GraphQL: [Hasura](https://github.com/hasura/graphql-engine)
- Authentication: [Hasura Auth](https://github.com/nhost/hasura-auth)
- Storage: [Hasura Storage](https://github.com/nhost/hasura-storage)
- Functions: [Node.js](https://nodejs.org/en/)

View File

@@ -0,0 +1,5 @@
{
"label": "Quickstarts",
"position": 3,
"collapsed": false
}

View File

@@ -0,0 +1,8 @@
---
title: 'Quickstart: Next.js'
sidebar_position: 2
---
## Introduction
This is a quickstart guide for React with Nhost.

View File

@@ -0,0 +1,8 @@
---
title: 'Quickstart: React'
sidebar_position: 1
---
## Introduction
This is a quickstart guide for React with Nhost.

View File

@@ -1,4 +1,4 @@
{
"label": "Serverless Functions",
"position": 6
"position": 8
}

View File

@@ -15,7 +15,7 @@ Event triggers are managed in Hasura. Go to Hasura, then select **Events** in th
![Creating event trigger in Hasura](/img/platform/hasura-create-event-trigger.png)
Nhost's [environment variables](/platform/nhost/environment-variables) can be used in event trigger headers. For example, you can attach `NHOST_WEBHOOK_SECRET` to an outgoing webhook here.
Nhost's [environment variables](/platform/environment-variables) can be used in event trigger headers. For example, you can attach `NHOST_WEBHOOK_SECRET` to an outgoing webhook here.
---

View File

@@ -1,4 +1,4 @@
{
"label": "Storage",
"position": 5
"position": 7
}

View File

@@ -4,6 +4,7 @@ title: signUp()
sidebar_label: signUp()
slug: /reference/javascript/auth/sign-up
description: Use `signUp` to sign up users using email an password.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L106
---
# `signUp()`

View File

@@ -4,6 +4,7 @@ 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.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L166
---
# `signIn()`

View File

@@ -4,6 +4,7 @@ title: signOut()
sidebar_label: signOut()
slug: /reference/javascript/auth/sign-out
description: Use `signOut` to sign out a user
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L315
---
# `signOut()`

View File

@@ -4,6 +4,7 @@ title: resetPassword()
sidebar_label: resetPassword()
slug: /reference/javascript/auth/reset-password
description: Use `resetPassword` to reset a user's password.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L342
---
# `resetPassword()`

View File

@@ -4,6 +4,7 @@ title: changePassword()
sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password
description: Use `changePassword` to change a user's password.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L367
---
# `changePassword()`

View File

@@ -4,6 +4,7 @@ title: sendVerificationEmail()
sidebar_label: sendVerificationEmail()
slug: /reference/javascript/auth/send-verification-email
description: Use `sendVerificationEmail` to send a verification email to the specified email.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L393
---
# `sendVerificationEmail()`

View File

@@ -4,6 +4,7 @@ title: changeEmail()
sidebar_label: changeEmail()
slug: /reference/javascript/auth/change-email
description: Use `changeEmail` to change a user's email
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L420
---
# `changeEmail()`

View File

@@ -4,6 +4,7 @@ title: deanonymize()
sidebar_label: deanonymize()
slug: /reference/javascript/auth/deanonymize
description: Use `deanonymize` to deanonymize a user
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L445
---
# `deanonymize()`

View File

@@ -4,6 +4,7 @@ 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.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L479
---
# `onTokenChanged()`

View File

@@ -4,6 +4,7 @@ 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.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L516
---
# `onAuthStateChanged()`

View File

@@ -4,6 +4,7 @@ title: isAuthenticated()
sidebar_label: isAuthenticated()
slug: /reference/javascript/auth/is-authenticated
description: Use `isAuthenticated` to check if the user is authenticated or not.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L556
---
# `isAuthenticated()`

View File

@@ -4,6 +4,7 @@ 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.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L574
---
# `isAuthenticatedAsync()`

View File

@@ -4,6 +4,7 @@ title: getAuthenticationStatus()
sidebar_label: getAuthenticationStatus()
slug: /reference/javascript/auth/get-authentication-status
description: Use `getAuthenticationStatus` to get the authentication status of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L601
---
# `getAuthenticationStatus()`

View File

@@ -5,6 +5,7 @@ sidebar_label: getJWTToken()
slug: /reference/javascript/auth/get-jwt-token
sidebar_class_name: deprecated
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L615
---
# `getJWTToken()`

View File

@@ -4,6 +4,7 @@ title: getAccessToken()
sidebar_label: getAccessToken()
slug: /reference/javascript/auth/get-access-token
description: Use `getAccessToken` to get the logged in user's access token.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L629
---
# `getAccessToken()`

View File

@@ -4,6 +4,7 @@ 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)
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L637
---
# `getDecodedAccessToken()`

View File

@@ -4,6 +4,7 @@ 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)
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L647
---
# `getHasuraClaims()`

View File

@@ -4,6 +4,7 @@ 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)
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L657
---
# `getHasuraClaim()`

View File

@@ -4,6 +4,7 @@ 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`.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L676
---
# `refreshSession()`

View File

@@ -4,6 +4,7 @@ title: getSession()
sidebar_label: getSession()
slug: /reference/javascript/auth/get-session
description: Use `getSession()` to get the current session.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L719
---
# `getSession()`

View File

@@ -4,6 +4,7 @@ title: getUser()
sidebar_label: getUser()
slug: /reference/javascript/auth/get-user
description: Use `getUser()` to get the current user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L734
---
# `getUser()`

View File

@@ -4,6 +4,7 @@ title: HasuraAuthClient
sidebar_label: Auth
description: No description provided.
slug: /reference/javascript/auth
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L64
---
# `HasuraAuthClient`
@@ -14,18 +15,17 @@ slug: /reference/javascript/auth
**<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 |
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>url</span> | `string` | ✔️ | |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="@alias autoSignIn - use autoSignIn instead">⚠️</span> | `boolean` | | |
| <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"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</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 deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</span> | [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter) | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -4,6 +4,7 @@ title: ApiChangeEmailResponse
sidebar_label: ApiChangeEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L170
---
# `ApiChangeEmailResponse`

View File

@@ -4,6 +4,7 @@ title: ApiChangePasswordResponse
sidebar_label: ApiChangePasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L162
---
# `ApiChangePasswordResponse`

View File

@@ -4,6 +4,7 @@ title: ApiDeanonymizeResponse
sidebar_label: ApiDeanonymizeResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L174
---
# `ApiDeanonymizeResponse`

View File

@@ -4,6 +4,7 @@ title: ApiError
sidebar_label: ApiError
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L27
---
# `ApiError`

View File

@@ -4,6 +4,7 @@ title: ApiRefreshTokenResponse
sidebar_label: ApiRefreshTokenResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L150
---
# `ApiRefreshTokenResponse`

View File

@@ -4,6 +4,7 @@ title: ApiResetPasswordResponse
sidebar_label: ApiResetPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L158
---
# `ApiResetPasswordResponse`

View File

@@ -4,6 +4,7 @@ title: ApiSendVerificationEmailResponse
sidebar_label: ApiSendVerificationEmailResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L166
---
# `ApiSendVerificationEmailResponse`

View File

@@ -4,6 +4,7 @@ title: ApiSignInData
sidebar_label: ApiSignInData
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
---
# `ApiSignInData`

View File

@@ -4,6 +4,7 @@ title: ApiSignInResponse
sidebar_label: ApiSignInResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L143
---
# `ApiSignInResponse`

View File

@@ -4,6 +4,7 @@ title: ApiSignOutResponse
sidebar_label: ApiSignOutResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L154
---
# `ApiSignOutResponse`

View File

@@ -4,6 +4,7 @@ title: ApiSignUpEmailPasswordResponse
sidebar_label: ApiSignUpEmailPasswordResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L135
---
# `ApiSignUpEmailPasswordResponse`

View File

@@ -4,6 +4,7 @@ title: AuthChangeEvent
sidebar_label: AuthChangeEvent
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L117
---
# `AuthChangeEvent`

View File

@@ -4,6 +4,7 @@ title: AuthChangedFunction
sidebar_label: AuthChangedFunction
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L119
---
# `AuthChangedFunction`

View File

@@ -4,6 +4,7 @@ title: ChangeEmailParams
sidebar_label: ChangeEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L91
---
# `ChangeEmailParams`

View File

@@ -4,6 +4,7 @@ title: ChangePasswordParams
sidebar_label: ChangePasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L82
---
# `ChangePasswordParams`

View File

@@ -1,19 +0,0 @@
---
# ⚠️ 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'
```

View File

@@ -1,49 +0,0 @@
---
# ⚠️ 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`
---

View File

@@ -4,6 +4,7 @@ title: DeanonymizeParams
sidebar_label: DeanonymizeParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L97
---
# `DeanonymizeParams`

View File

@@ -4,6 +4,7 @@ title: Headers
sidebar_label: Headers
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L128
---
# `Headers`

View File

@@ -4,6 +4,7 @@ title: LoginData
sidebar_label: LoginData
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L123
---
# `LoginData`

View File

@@ -4,6 +4,7 @@ title: Mfa
sidebar_label: Mfa
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L131
---
# `Mfa`

View File

@@ -4,6 +4,7 @@ title: NhostAuthConstructorParams
sidebar_label: NhostAuthConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L14
---
# `NhostAuthConstructorParams`
@@ -16,7 +17,11 @@ displayed_sidebar: referenceSidebar
---
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
:::caution Deprecated
@alias autoSignIn - use autoSignIn instead
:::
---
@@ -30,57 +35,43 @@ When set to true, will parse the url on startup to check if it contains a refres
---
**<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)
**<span className="parameter-name deprecated">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)
Define a way to set information about the refresh token and its exipration date.
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
Use clientStorage / clientStorageType instead
:::
---
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
**<span className="parameter-name deprecated">clientStorageGetter</span>** <span className="optional-status">optional</span> [`StorageGetter`](/reference/docgen/javascript/auth/types/storage-getter)
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
Use clientStorage / clientStorageType 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">clientStorage</span>** <span className="optional-status">optional</span> `ClientStorage`
Object where the refresh token will be persisted and read locally.
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">optional</span> `ClientStorageType`
Define a way to get information about the refresh token and its exipration date.
**`@default`**
`web`
---

View File

@@ -4,6 +4,7 @@ title: OnTokenChangedFunction
sidebar_label: OnTokenChangedFunction
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L121
---
# `OnTokenChangedFunction`

View File

@@ -4,6 +4,7 @@ title: Provider
sidebar_label: Provider
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L138
---
# `Provider`

View File

@@ -4,6 +4,7 @@ title: ResetPasswordParams
sidebar_label: ResetPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L77
---
# `ResetPasswordParams`

View File

@@ -4,6 +4,7 @@ title: SendVerificationEmailParams
sidebar_label: SendVerificationEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L86
---
# `SendVerificationEmailParams`

View File

@@ -4,6 +4,7 @@ title: Session
sidebar_label: Session
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L21
---
# `Session`

View File

@@ -4,6 +4,7 @@ title: SignInEmailPasswordParams
sidebar_label: SignInEmailPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L46
---
# `SignInEmailPasswordParams`

View File

@@ -4,6 +4,7 @@ title: SignInParams
sidebar_label: SignInParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L70
---
# `SignInParams`

View File

@@ -4,6 +4,7 @@ title: SignInPasswordlessEmailParams
sidebar_label: SignInPasswordlessEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L51
---
# `SignInPasswordlessEmailParams`

View File

@@ -4,6 +4,7 @@ title: SignInPasswordlessSmsOtpParams
sidebar_label: SignInPasswordlessSmsOtpParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L61
---
# `SignInPasswordlessSmsOtpParams`

View File

@@ -4,6 +4,7 @@ title: SignInPasswordlessSmsParams
sidebar_label: SignInPasswordlessSmsParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L56
---
# `SignInPasswordlessSmsParams`

View File

@@ -4,6 +4,7 @@ title: SignInReponse
sidebar_label: SignInReponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L106
---
# `SignInReponse`

View File

@@ -4,6 +4,7 @@ title: SignInWithProviderOptions
sidebar_label: SignInWithProviderOptions
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L65
---
# `SignInWithProviderOptions`

View File

@@ -4,6 +4,7 @@ title: SignUpEmailPasswordParams
sidebar_label: SignUpEmailPasswordParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L33
---
# `SignUpEmailPasswordParams`

View File

@@ -4,6 +4,7 @@ title: SignUpParams
sidebar_label: SignUpParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L39
---
# `SignUpParams`

View File

@@ -4,6 +4,7 @@ title: SignUpResponse
sidebar_label: SignUpResponse
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L41
---
# `SignUpResponse`

View File

@@ -4,6 +4,7 @@ title: StorageGetter
sidebar_label: StorageGetter
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/storage.ts#L4
---
# `StorageGetter`

View File

@@ -4,6 +4,7 @@ title: StorageSetter
sidebar_label: StorageSetter
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/storage.ts#L5
---
# `StorageSetter`

View File

@@ -4,6 +4,7 @@ title: User
sidebar_label: User
description: User information
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L91
---
# `User`

View File

@@ -4,6 +4,7 @@ title: createClient()
sidebar_label: createClient()
slug: /reference/javascript/nhost-js/create-client
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/index.ts#L3
---
# `createClient()`
@@ -14,18 +15,17 @@ description: No description provided.
**<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` | | |
| 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"><span className="light-grey">config.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">config.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorageGetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</span> | `StorageGetter` | | |
| <span className="parameter-name deprecated"><span className="light-grey">config.</span>clientStorageSetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</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"><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 deprecated"><span className="light-grey">config.</span>autoLogin</span> <span className="deprecation-sign" title="@alias autoSignIn - use autoSignIn instead">⚠️</span> | `boolean` | | |
---

View File

@@ -4,6 +4,7 @@ title: NhostClient
sidebar_label: NhostClient
description: No description provided.
slug: /reference/javascript/nhost-js/nhost-client
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/core/nhost-client.ts#L14
---
# `NhostClient`
@@ -16,18 +17,17 @@ Nhost Client
**<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 |
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | `string` | ✔️ | Nhost backend URL. |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>autoLogin</span> <span className="deprecation-sign" title="@alias autoSignIn - use autoSignIn instead">⚠️</span> | `boolean` | | |
| <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"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageSetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</span> | `StorageSetter` | | Define a way to set information about the refresh token and its exipration date. |
| <span className="parameter-name deprecated"><span className="light-grey">\_\_namedParameters.</span>clientStorageGetter</span> <span className="deprecation-sign" title="Use clientStorage / clientStorageType instead">⚠️</span> | `StorageGetter` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -4,6 +4,7 @@ title: call()
sidebar_label: call()
slug: /reference/javascript/nhost-js/functions/call
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions.ts#L24
---
# `call()`

View File

@@ -4,6 +4,7 @@ title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/nhost-js/functions/set-access-token
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions.ts#L53
---
# `setAccessToken()`

View File

@@ -4,6 +4,7 @@ title: NhostFunctionsClient
sidebar_label: Functions
description: No description provided.
slug: /reference/javascript/nhost-js/functions
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions.ts#L11
---
# `NhostFunctionsClient`

View File

@@ -4,6 +4,7 @@ title: request()
sidebar_label: request()
slug: /reference/javascript/nhost-js/graphql/request
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L29
---
# `request()`

View File

@@ -4,6 +4,7 @@ title: getUrl()
sidebar_label: getUrl()
slug: /reference/javascript/nhost-js/graphql/get-url
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L82
---
# `getUrl()`

View File

@@ -4,6 +4,7 @@ title: setAccessToken()
sidebar_label: setAccessToken()
slug: /reference/javascript/nhost-js/graphql/set-access-token
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L86
---
# `setAccessToken()`

View File

@@ -4,6 +4,7 @@ title: NhostGraphqlClient
sidebar_label: GraphQL
description: No description provided.
slug: /reference/javascript/nhost-js/graphql
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L14
---
# `NhostGraphqlClient`

View File

@@ -4,6 +4,7 @@ title: NhostClientConstructorParams
sidebar_label: NhostClientConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/core/nhost-client.ts#L7
---
# `NhostClientConstructorParams`
@@ -24,48 +25,46 @@ Time interval until token refreshes, in seconds
---
**<span className="parameter-name deprecated">clientStorage</span>** <span className="optional-status">optional</span> `ClientStorage`
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">optional</span> `ClientStorageType`
Define a way to get information about the refresh token and its exipration date.
**`@default`**
`web`
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> `ClientStorage`
Object where the refresh token will be persisted and read locally.
---
**<span className="parameter-name deprecated">clientStorageGetter</span>** <span className="optional-status">optional</span> `StorageGetter`
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
Use clientStorage / clientStorageType instead
:::
---
**<span className="parameter-name deprecated">clientStorageType</span>** <span className="optional-status">optional</span> `ClientStorageType`
**<span className="parameter-name deprecated">clientStorageSetter</span>** <span className="optional-status">optional</span> `StorageSetter`
Define a way to set information about the refresh token and its exipration date.
:::caution Deprecated
Use clientStorageGetter and clientStorageSetter options instead
Use clientStorage / clientStorageType 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
@@ -76,6 +75,10 @@ When set to true, will parse the url on startup to check if it contains a refres
---
**<span className="parameter-name">Client</span>** <span className="optional-status">optional</span> `AuthClient`
**<span className="parameter-name deprecated">autoLogin</span>** <span className="optional-status">optional</span> `boolean`
:::caution Deprecated
@alias autoSignIn - use autoSignIn instead
:::
---

View File

@@ -4,6 +4,7 @@ title: NhostFunctionsConstructorParams
sidebar_label: NhostFunctionsConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/functions.ts#L4
---
# `NhostFunctionsConstructorParams`

View File

@@ -4,6 +4,7 @@ title: NhostGraphqlConstructorParams
sidebar_label: NhostGraphqlConstructorParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/clients/graphql.ts#L7
---
# `NhostGraphqlConstructorParams`

View File

@@ -4,6 +4,7 @@ title: upload()
sidebar_label: upload()
slug: /reference/javascript/storage/upload
description: Use `.upload` to upload a file.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-client.ts#L32
---
# `upload()`

Some files were not shown because too many files have changed in this diff Show More