Compare commits
106 Commits
@nhost/rea
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1035639850 | ||
|
|
0e96e7329e | ||
|
|
19ccc5ab0d | ||
|
|
e094e682ce | ||
|
|
74eb71f8f0 | ||
|
|
a931c15073 | ||
|
|
9ae5e485e6 | ||
|
|
2965a7bf5b | ||
|
|
236ce72bb3 | ||
|
|
5ad5832e41 | ||
|
|
1e233b6582 | ||
|
|
9ebd014287 | ||
|
|
6ce2534a36 | ||
|
|
9f8e792f0d | ||
|
|
e1383106d9 | ||
|
|
812d7a8eae | ||
|
|
2887ce0f82 | ||
|
|
8bdfb8fcac | ||
|
|
573436dd87 | ||
|
|
f58c2bb9ce | ||
|
|
4eac3101c9 | ||
|
|
80bd938336 | ||
|
|
41db6f613a | ||
|
|
ee84bfa098 | ||
|
|
ad1b7b80e2 | ||
|
|
3fcd345cff | ||
|
|
43a3f1dd46 | ||
|
|
3ec745c91e | ||
|
|
92deec4531 | ||
|
|
c7fcc9fe82 | ||
|
|
081377af6c | ||
|
|
23cb207afc | ||
|
|
8a79a7102f | ||
|
|
0f55f6db9b | ||
|
|
7b16a8d790 | ||
|
|
dca8233601 | ||
|
|
a7535b260b | ||
|
|
82520963f1 | ||
|
|
722abd9a19 | ||
|
|
2aff6c0b4e | ||
|
|
e101915f60 | ||
|
|
0195143fe1 | ||
|
|
e362925041 | ||
|
|
b4f8c7457d | ||
|
|
84f1ab2f61 | ||
|
|
dee93bb873 | ||
|
|
173b587802 | ||
|
|
30ef1660b4 | ||
|
|
a613aa9f0c | ||
|
|
3c03b9b46f | ||
|
|
65a3061146 | ||
|
|
55864eac30 | ||
|
|
28494d6c1f | ||
|
|
34532b1a2f | ||
|
|
de3257ca7a | ||
|
|
9d32314065 | ||
|
|
67f0450dac | ||
|
|
584976d1ad | ||
|
|
509ed7d864 | ||
|
|
71b92363b4 | ||
|
|
bb548cd108 | ||
|
|
adb30c537f | ||
|
|
d7d3e8f903 | ||
|
|
8a4064e99f | ||
|
|
937e28116b | ||
|
|
d885fe7b02 | ||
|
|
b0d7217276 | ||
|
|
bfba4ae7ec | ||
|
|
44b12dc0a0 | ||
|
|
bf6ee5d360 | ||
|
|
9f8bdb504d | ||
|
|
cd2594f66a | ||
|
|
c6a3e9f516 | ||
|
|
1bfb1e6d10 | ||
|
|
35fd7b1b7c | ||
|
|
04c1ed6955 | ||
|
|
0c591daef4 | ||
|
|
6f5729eb45 | ||
|
|
9bc447dbff | ||
|
|
d2d0e7fced | ||
|
|
0ad654226b | ||
|
|
9d8f2dea22 | ||
|
|
f3a44931a5 | ||
|
|
1c1656441b | ||
|
|
5f68f8fe31 | ||
|
|
961103d7a5 | ||
|
|
2bebab3f8e | ||
|
|
0363abbbb1 | ||
|
|
2f3715d02a | ||
|
|
7c101e5226 | ||
|
|
ef943995e2 | ||
|
|
b6032508bc | ||
|
|
a6b00294e7 | ||
|
|
dbfc5ec220 | ||
|
|
6ffaf31af5 | ||
|
|
8ec18157bb | ||
|
|
175ab26e04 | ||
|
|
eb2d064cbe | ||
|
|
17d2c8c3d9 | ||
|
|
4e0aab1bb2 | ||
|
|
1bde3e6516 | ||
|
|
3674f11183 | ||
|
|
76b3cb4643 | ||
|
|
556190dfc5 | ||
|
|
69f3a84bf5 | ||
|
|
16dcd314bb |
@@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es6": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["**/dist", "**/build", "**/.next"],
|
|
||||||
"extends": ["react-app", "plugin:react/recommended", "plugin:react-hooks/recommended"],
|
|
||||||
"parserOptions": {
|
|
||||||
// "project": "./tsconfig.json"
|
|
||||||
"project": ["packages/*/tsconfig.json", "examples/*/tsconfig.json"]
|
|
||||||
},
|
|
||||||
"plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort"],
|
|
||||||
"rules": {
|
|
||||||
"no-use-before-define": "off",
|
|
||||||
"simple-import-sort/exports": "error",
|
|
||||||
|
|
||||||
"simple-import-sort/imports": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"groups": [
|
|
||||||
// Node.js builtins. You could also generate this regex if you use a `.js` config.
|
|
||||||
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
|
|
||||||
[
|
|
||||||
"^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)"
|
|
||||||
],
|
|
||||||
// Packages
|
|
||||||
["^\\w"],
|
|
||||||
// Internal packages.
|
|
||||||
["^(@|config/)(/*|$)"],
|
|
||||||
// Side effect imports.
|
|
||||||
["^\\u0000"],
|
|
||||||
// Parent imports. Put `..` last.
|
|
||||||
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
|
|
||||||
// Other relative imports. Put same-folder imports and `.` last.
|
|
||||||
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
|
|
||||||
// Style imports.
|
|
||||||
["^.+\\.s?css$"]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"import/no-anonymous-default-export": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"allowArrowFunction": true,
|
|
||||||
"allowAnonymousFunction": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
const esbuild = require('esbuild')
|
|
||||||
|
|
||||||
// Automatically exclude all node_modules from the bundled version
|
|
||||||
const { nodeExternalsPlugin } = require('esbuild-node-externals')
|
|
||||||
esbuild
|
|
||||||
.build({
|
|
||||||
entryPoints: ['./src/index.ts'],
|
|
||||||
outfile: 'dist/index.cjs.js',
|
|
||||||
bundle: true,
|
|
||||||
minify: true,
|
|
||||||
platform: 'node',
|
|
||||||
format: 'cjs',
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'node14',
|
|
||||||
plugins: [nodeExternalsPlugin()]
|
|
||||||
})
|
|
||||||
.catch(() => process.exit(1))
|
|
||||||
|
|
||||||
esbuild
|
|
||||||
.build({
|
|
||||||
entryPoints: ['./src/index.ts'],
|
|
||||||
outfile: 'dist/index.es.js',
|
|
||||||
bundle: true,
|
|
||||||
minify: true,
|
|
||||||
platform: 'browser',
|
|
||||||
format: 'esm',
|
|
||||||
sourcemap: true,
|
|
||||||
target: 'es2019'
|
|
||||||
})
|
|
||||||
.catch(() => process.exit(1))
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
const base = require('./jest.config.base.js')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
...base,
|
|
||||||
projects: ['<rootDir>/packages/*/jest.config.js'],
|
|
||||||
coverageDirectory: '<rootDir>/coverage/'
|
|
||||||
}
|
|
||||||
1
.github/workflows/changesets.yaml
vendored
1
.github/workflows/changesets.yaml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
- 'examples/**'
|
- 'examples/**'
|
||||||
- 'assets/**'
|
- 'assets/**'
|
||||||
- '**.md'
|
- '**.md'
|
||||||
|
- '!.changeset/**'
|
||||||
- 'LICENSE'
|
- 'LICENSE'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -19,6 +19,7 @@ logs/
|
|||||||
# Directories
|
# Directories
|
||||||
coverage/
|
coverage/
|
||||||
dist/
|
dist/
|
||||||
|
umd/
|
||||||
lib/
|
lib/
|
||||||
node_modules/
|
node_modules/
|
||||||
tmp/
|
tmp/
|
||||||
@@ -32,16 +33,15 @@ tmp/
|
|||||||
*.map
|
*.map
|
||||||
todo.md
|
todo.md
|
||||||
|
|
||||||
# Generated configs
|
# Config files that are not part of the repository root anymore. Should be removed in the future.
|
||||||
/.eslintignore
|
/.eslintignore
|
||||||
/.eslintrc
|
/.eslintrc*
|
||||||
/.prettierignore
|
|
||||||
/prettier.config.js
|
|
||||||
/vite.*.js
|
/vite.*.js
|
||||||
/jest.*.js
|
/jest.*.js
|
||||||
|
/*tsconfig*.json
|
||||||
/esbuild.*.js
|
/esbuild.*.js
|
||||||
|
|
||||||
!.config/**
|
!config/**
|
||||||
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ module.exports = {
|
|||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
trailingComma: 'none',
|
trailingComma: 'none',
|
||||||
useTabs: false,
|
useTabs: false,
|
||||||
|
// TODO: add import sort configuration to match ESLint rules
|
||||||
|
// plugins: ['./node_modules/@trivago/prettier-plugin-sort-imports'],
|
||||||
|
// importOrderSeparation: true,
|
||||||
|
// importOrderSortSpecifiers: true
|
||||||
|
plugins: [],
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['*.json', '*.yaml'],
|
files: ['*.json', '*.yaml'],
|
||||||
@@ -18,7 +23,5 @@ module.exports = {
|
|||||||
useTabs: false
|
useTabs: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
importOrderSeparation: true,
|
|
||||||
importOrderSortSpecifiers: true
|
|
||||||
}
|
}
|
||||||
@@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
## Requirements
|
## 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`:
|
- We use [pnpm](https://pnpm.io/) as a package manager to speed up development and builds, and as a basis for our monorepo. You need to make sure it's installed on your machine. There are [several ways to install it](https://pnpm.io/installation), but the easiest way is with `npm`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install -g pnpm
|
$ 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)
|
- Our tests and examples use the Nhost CLI, to run the backend services locally. You can follow the installation instructions in [our documentation](https://docs.nhost.io/get-started/cli-workflow/install-cli).
|
||||||
|
|
||||||
## Getting things ready
|
## Get started
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
|
||||||
First, clone this repository:
|
First, clone this repository:
|
||||||
|
|
||||||
@@ -21,57 +23,74 @@ git clone https://github.com/nhost/nhost
|
|||||||
Then, install the dependencies with `pnpm`:
|
Then, install the dependencies with `pnpm`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd nhost
|
$ cd nhost
|
||||||
pnpm install
|
$ pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
## Starting development from an example
|
### Development
|
||||||
|
|
||||||
Let's follow the instructions to start [react-apollo example](https://github.com/nhost/nhost/blob/main/examples/react-apollo/README.md).
|
Although package references are correctly updated on the fly for TypeScript, example projects won't
|
||||||
|
see the changes because they are depending on the build output. To fix this, you can run packages
|
||||||
|
in development mode.
|
||||||
|
|
||||||
## Running the documentation website locally
|
Running packages in development mode is as simple as:
|
||||||
|
|
||||||
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
|
```sh
|
||||||
cd docs
|
$ pnpm dev
|
||||||
# not necessary step if you've done this step already anywhere in the repository
|
|
||||||
pnpm install
|
|
||||||
pnpm start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Testing
|
Our packages are linked together using [PNPM's workspace](https://pnpm.io/workspaces) feature. Vite automatically detects changes in the dependencies and rebuilds everything, so that the changes are immediately reflected in the other packages.
|
||||||
|
|
||||||
In order to run tests, the Nhost testing backend should run locally. You can start it in from a separate terminal:
|
### Use examples
|
||||||
|
|
||||||
|
Examples are a great way to test your changes in practice. Make sure you've `pnpm dev` running in your terminal and then run an example.
|
||||||
|
|
||||||
|
Let's follow the instructions to run [react-apollo example](https://github.com/nhost/nhost/blob/main/examples/react-apollo/README.md).
|
||||||
|
|
||||||
|
## Run the documentation website locally
|
||||||
|
|
||||||
|
The easier way to contribute to our documentation is to go to the `docs` folder and follow the [instructions to start local development](https://github.com/nhost/nhost/blob/main/docs/README.md):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd examples/testing-project
|
$ cd docs
|
||||||
nhost -d
|
# not necessary if you've already done this step somewhere in the repository
|
||||||
|
$ pnpm install
|
||||||
|
$ pnpm start
|
||||||
```
|
```
|
||||||
|
|
||||||
Once Nhost started locally, you can run the tests from the root folder of the repository with the following command:
|
## Run test suites
|
||||||
|
|
||||||
|
In order to run tests, the Nhost testing backend should be running locally. You can run it from a separate terminal:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm test
|
$ cd examples/testing-project
|
||||||
|
$ nhost -d
|
||||||
|
```
|
||||||
|
|
||||||
|
Once Nhost is started locally, you can run the tests with the following command from the repository root:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ pnpm test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Changesets
|
## 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.
|
If you've made changes to the packages, you must describe those changes so that they can be reflected 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.
|
We use [changesets](https://github.com/changesets/changesets) to support our versioning and release workflows. When you submit a pull request, a bot checks if some changesets are present, and if not, it directs 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:
|
The most comprehensive way to add a changeset is to run the following command in the repository root:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm changeset
|
$ 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.
|
This will create a file in the `.changeset` directory. You can edit it to give more 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 can take a look at the changeset documentation: [How to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
|
||||||
|
|
||||||
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).
|
## Committing changes
|
||||||
|
|
||||||
|
You'll notice that `git commit` takes a few seconds to run. We set a commit hook that scans the changes in the code, automatically generates documentation from the inline [TSDoc](https://tsdoc.org/) annotations, and adds these generated documentation files to the commit. They automatically update the [reference documentation](https://docs.nhost.io/reference).
|
||||||
|
|
||||||
<!-- ## Good practices
|
<!-- ## Good practices
|
||||||
- lint
|
- lint
|
||||||
|
|||||||
24
README.md
24
README.md
@@ -134,13 +134,6 @@ Here are some ways of contributing to making Nhost better:
|
|||||||
<sub><b>Pilou</b></sub>
|
<sub><b>Pilou</b></sub>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
|
||||||
<a href="https://github.com/elitan">
|
|
||||||
<img src="https://avatars.githubusercontent.com/u/331818?v=4" width="100;" alt="elitan"/>
|
|
||||||
<br />
|
|
||||||
<sub><b>Johan Eliasson</b></sub>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="https://github.com/szilarddoro">
|
<a href="https://github.com/szilarddoro">
|
||||||
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
|
<img src="https://avatars.githubusercontent.com/u/310881?v=4" width="100;" alt="szilarddoro"/>
|
||||||
@@ -148,6 +141,13 @@ Here are some ways of contributing to making Nhost better:
|
|||||||
<sub><b>Szilárd Dóró</b></sub>
|
<sub><b>Szilárd Dóró</b></sub>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/elitan">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/331818?v=4" width="100;" alt="elitan"/>
|
||||||
|
<br />
|
||||||
|
<sub><b>Johan Eliasson</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="https://github.com/nunopato">
|
<a href="https://github.com/nunopato">
|
||||||
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
|
<img src="https://avatars.githubusercontent.com/u/1523504?v=4" width="100;" alt="nunopato"/>
|
||||||
@@ -320,6 +320,13 @@ Here are some ways of contributing to making Nhost better:
|
|||||||
<sub><b>Jacob Duval</b></sub>
|
<sub><b>Jacob Duval</b></sub>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="https://github.com/MarcelloTheArcane">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
|
||||||
|
<br />
|
||||||
|
<sub><b>Max Reynolds</b></sub>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="https://github.com/ghoshnirmalya">
|
<a href="https://github.com/ghoshnirmalya">
|
||||||
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
|
<img src="https://avatars.githubusercontent.com/u/6391763?v=4" width="100;" alt="ghoshnirmalya"/>
|
||||||
@@ -333,7 +340,8 @@ Here are some ways of contributing to making Nhost better:
|
|||||||
<br />
|
<br />
|
||||||
<sub><b>Quentin Decré</b></sub>
|
<sub><b>Quentin Decré</b></sub>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td></tr>
|
||||||
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="https://github.com/komninoschat">
|
<a href="https://github.com/komninoschat">
|
||||||
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>
|
<img src="https://avatars.githubusercontent.com/u/29049104?v=4" width="100;" alt="komninoschat"/>
|
||||||
|
|||||||
65
config/.eslintrc.js
Normal file
65
config/.eslintrc.js
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
es6: true,
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
ignorePatterns: [
|
||||||
|
'dist',
|
||||||
|
'umd',
|
||||||
|
'build',
|
||||||
|
'.next',
|
||||||
|
'node_modules',
|
||||||
|
'tsup.config.ts',
|
||||||
|
'__tests__',
|
||||||
|
'__mocks__',
|
||||||
|
'*.test.ts',
|
||||||
|
'*.test.tsx',
|
||||||
|
'*.spec.ts',
|
||||||
|
'*.spec.tsx',
|
||||||
|
'tests/**/*.ts',
|
||||||
|
'tests/**/*.d.ts'
|
||||||
|
],
|
||||||
|
extends: ['react-app', 'plugin:react/recommended', 'plugin:react-hooks/recommended'],
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
plugins: ['react', '@typescript-eslint', 'react-hooks', 'simple-import-sort'],
|
||||||
|
rules: {
|
||||||
|
'react/prop-types': 'off',
|
||||||
|
'no-use-before-define': 'off',
|
||||||
|
'simple-import-sort/exports': 'error',
|
||||||
|
'simple-import-sort/imports': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
groups: [
|
||||||
|
// Node.js builtins. You could also generate this regex if you use a `.js` config.
|
||||||
|
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
|
||||||
|
[
|
||||||
|
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)'
|
||||||
|
],
|
||||||
|
// Packages
|
||||||
|
['^\\w'],
|
||||||
|
// Internal packages.
|
||||||
|
['^(@|config/)(/*|$)'],
|
||||||
|
// Side effect imports.
|
||||||
|
['^\\u0000'],
|
||||||
|
// Parent imports. Put `..` last.
|
||||||
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
||||||
|
// Other relative imports. Put same-folder imports and `.` last.
|
||||||
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
||||||
|
// Style imports.
|
||||||
|
['^.+\\.s?css$']
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'import/no-anonymous-default-export': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
allowArrowFunction: true,
|
||||||
|
allowAnonymousFunction: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ module.exports = {
|
|||||||
testRegex: '(/tests/.*.(test|spec)).(jsx?|tsx?)$',
|
testRegex: '(/tests/.*.(test|spec)).(jsx?|tsx?)$',
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||||
collectCoverage: true,
|
collectCoverage: true,
|
||||||
// coveragePathIgnorePatterns: ['(tests/.*.mock).(jsx?|tsx?)$'],
|
|
||||||
verbose: true,
|
verbose: true,
|
||||||
testTimeout: 30000,
|
testTimeout: 30000,
|
||||||
globals: {
|
globals: {
|
||||||
15
config/jest.config.js
Normal file
15
config/jest.config.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
module.exports = {
|
||||||
|
rootDir: process.cwd(),
|
||||||
|
preset: 'ts-jest',
|
||||||
|
collectCoverage: true,
|
||||||
|
coverageProvider: 'v8',
|
||||||
|
coverageDirectory: '<rootDir>/coverage',
|
||||||
|
clearMocks: true,
|
||||||
|
verbose: true,
|
||||||
|
testTimeout: 30000,
|
||||||
|
globals: {
|
||||||
|
'ts-jest': {
|
||||||
|
isolatedModules: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
config/react-library.tsconfig.json
Normal file
8
config/react-library.tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"display": "React Library",
|
||||||
|
"extends": "./tsconfig.base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"jsx": "preserve"
|
||||||
|
}
|
||||||
|
}
|
||||||
56
config/tsconfig.base.json
Normal file
56
config/tsconfig.base.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"display": "Default",
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": false,
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"target": "ES6",
|
||||||
|
"module": "CommonJS",
|
||||||
|
"lib": [
|
||||||
|
"es5",
|
||||||
|
"dom",
|
||||||
|
"es2015.promise",
|
||||||
|
"es2015.symbol",
|
||||||
|
"es2015.iterable",
|
||||||
|
"es2015.collection",
|
||||||
|
"es2015.symbol.wellknown",
|
||||||
|
"es2015.core",
|
||||||
|
"es2017.object",
|
||||||
|
"es2017.string"
|
||||||
|
],
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"types": ["node"],
|
||||||
|
"typeRoots": [
|
||||||
|
"./node_modules/@types", "**/*/dist", "**/*/build", "**/*/.next", "**/*/umd"
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@nhost/apollo": ["../packages/apollo/src/index.ts"],
|
||||||
|
"@nhost/core": ["../packages/core/src/index.ts"],
|
||||||
|
"@nhost/docgen": ["../packages/docgen/src/index.ts"],
|
||||||
|
"@nhost/hasura-auth-js": ["../packages/hasura-auth-js/src/index.ts"],
|
||||||
|
"@nhost/hasura-storage-js": ["../packages/hasura-storage-js/src/index.ts"],
|
||||||
|
"@nhost/nextjs": ["../packages/nextjs/src/index.ts"],
|
||||||
|
"@nhost/nhost-js": ["../packages/nhost-js/src/index.ts"],
|
||||||
|
"@nhost/react": ["../packages/react/src/index.ts"],
|
||||||
|
"@nhost/react-apollo": ["../packages/react-apollo/src/index.ts"],
|
||||||
|
"@nhost/react-auth": ["../packages/react-auth/src/index.ts"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"**/*/dist",
|
||||||
|
"**/*/build",
|
||||||
|
"**/*/.next",
|
||||||
|
"**/*/__tests__",
|
||||||
|
"**/*/__mocks__"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -5,20 +5,19 @@ import { defineConfig } from 'vite'
|
|||||||
import dts from 'vite-plugin-dts'
|
import dts from 'vite-plugin-dts'
|
||||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||||
|
|
||||||
import react from '@vitejs/plugin-react'
|
|
||||||
|
|
||||||
const PWD = process.env.PWD
|
const PWD = process.env.PWD
|
||||||
const pkg = require(path.join(PWD, 'package.json'))
|
const pkg = require(path.join(PWD, 'package.json'))
|
||||||
|
|
||||||
const tsEntry = path.resolve(PWD, 'src/index.ts')
|
const tsEntry = path.resolve(PWD, 'src/index.ts')
|
||||||
const entry = fs.existsSync(tsEntry) ? tsEntry : tsEntry.replace('.ts', '.tsx')
|
const entry = fs.existsSync(tsEntry) ? tsEntry : tsEntry.replace('.ts', '.tsx')
|
||||||
|
|
||||||
/**
|
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies, pkg.dependencies))]
|
||||||
* @type {import('vite').UserConfig}
|
|
||||||
*/
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
optimizeDeps: {
|
||||||
|
include: ['react/jsx-runtime']
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
react(),
|
|
||||||
tsconfigPaths(),
|
tsconfigPaths(),
|
||||||
dts({
|
dts({
|
||||||
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
||||||
@@ -32,16 +31,29 @@ export default defineConfig({
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
|
sourcemap: true,
|
||||||
lib: {
|
lib: {
|
||||||
entry,
|
entry,
|
||||||
name: pkg.name,
|
name: pkg.name,
|
||||||
fileName: 'index'
|
fileName: 'index',
|
||||||
|
formats: ['cjs', 'es']
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['react', '@nhost/react'],
|
external: (id) => deps.some((dep) => id.startsWith(dep)),
|
||||||
output: {
|
output: {
|
||||||
globals: {
|
globals: {
|
||||||
react: 'react',
|
'graphql/language/printer': 'graphql/language/printer',
|
||||||
|
'@apollo/client': '@apollo/client',
|
||||||
|
'@apollo/client/link/context': '@apollo/client/link/context',
|
||||||
|
'@apollo/client/link/subscriptions': '@apollo/client/link/subscriptions',
|
||||||
|
'@apollo/client/utilities': '@apollo/client/utilities',
|
||||||
|
'graphql-ws': 'graphql-ws',
|
||||||
|
xstate: 'xstate',
|
||||||
|
axios: 'axios',
|
||||||
|
'js-cookie': 'Cookies',
|
||||||
|
react: 'React',
|
||||||
|
'react-dom': 'ReactDOM',
|
||||||
|
'react/jsx-runtime': '_jsx',
|
||||||
'@nhost/react': '@nhost/react'
|
'@nhost/react': '@nhost/react'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
13
config/vite.lib.dev.config.js
Normal file
13
config/vite.lib.dev.config.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from 'vite'
|
||||||
|
|
||||||
|
import viteLibConfig from './vite.lib.config'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
...viteLibConfig,
|
||||||
|
build: {
|
||||||
|
...viteLibConfig.build,
|
||||||
|
watch: {
|
||||||
|
buildDelay: 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
42
config/vite.lib.umd.config.js
Normal file
42
config/vite.lib.umd.config.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import dts from 'vite-plugin-dts'
|
||||||
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||||
|
|
||||||
|
import baseLibConfig from './vite.lib.config'
|
||||||
|
|
||||||
|
const PWD = process.env.PWD
|
||||||
|
const pkg = require(path.join(PWD, 'package.json'))
|
||||||
|
|
||||||
|
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies))]
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
tsconfigPaths(),
|
||||||
|
dts({
|
||||||
|
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
||||||
|
afterBuild: () => {
|
||||||
|
const types = fs.readdirSync(path.join(PWD, 'umd/src'))
|
||||||
|
types.forEach((file) => {
|
||||||
|
fs.renameSync(path.join(PWD, 'umd/src', file), path.join(PWD, 'umd', file))
|
||||||
|
})
|
||||||
|
fs.rmdirSync(path.join(PWD, 'umd/src'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
],
|
||||||
|
build: {
|
||||||
|
...(baseLibConfig.build || {}),
|
||||||
|
outDir: 'umd',
|
||||||
|
lib: {
|
||||||
|
...(baseLibConfig.build?.lib || {}),
|
||||||
|
fileName: pkg.name.replace(/@nhost\//g, ''),
|
||||||
|
formats: ['umd']
|
||||||
|
},
|
||||||
|
rollupOptions: {
|
||||||
|
...(baseLibConfig.build?.rollupOptions || {}),
|
||||||
|
external: (id) => deps.some((dep) => id.startsWith(dep))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
8
config/vite.react.config.js
Normal file
8
config/vite.react.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import baseLibConfig from './vite.lib.config'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
...baseLibConfig,
|
||||||
|
plugins: [react(), ...baseLibConfig.plugins]
|
||||||
|
})
|
||||||
12
config/vite.react.dev.config.js
Normal file
12
config/vite.react.dev.config.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import viteReactConfig from './vite.react.config'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
...viteReactConfig,
|
||||||
|
build: {
|
||||||
|
...viteReactConfig.build,
|
||||||
|
watch: {
|
||||||
|
buildDelay: 500
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
45
config/vite.react.umd.config.js
Normal file
45
config/vite.react.umd.config.js
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import fs from 'fs'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import dts from 'vite-plugin-dts'
|
||||||
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||||
|
|
||||||
|
import react from '@vitejs/plugin-react'
|
||||||
|
|
||||||
|
import baseLibConfig from './vite.lib.config'
|
||||||
|
|
||||||
|
const PWD = process.env.PWD
|
||||||
|
const pkg = require(path.join(PWD, 'package.json'))
|
||||||
|
|
||||||
|
const deps = [...Object.keys(Object.assign({}, pkg.peerDependencies))]
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
react(),
|
||||||
|
tsconfigPaths(),
|
||||||
|
dts({
|
||||||
|
exclude: ['**/*.spec.ts', '**/*.test.ts', '**/tests/**'],
|
||||||
|
afterBuild: () => {
|
||||||
|
const types = fs.readdirSync(path.join(PWD, 'umd/src'))
|
||||||
|
types.forEach((file) => {
|
||||||
|
fs.renameSync(path.join(PWD, 'umd/src', file), path.join(PWD, 'umd', file))
|
||||||
|
})
|
||||||
|
fs.rmdirSync(path.join(PWD, 'umd/src'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
],
|
||||||
|
build: {
|
||||||
|
...(baseLibConfig.build || {}),
|
||||||
|
outDir: 'umd',
|
||||||
|
lib: {
|
||||||
|
...(baseLibConfig.build?.lib || {}),
|
||||||
|
fileName: pkg.name.replace(/@nhost\//g, ''),
|
||||||
|
formats: ['umd']
|
||||||
|
},
|
||||||
|
rollupOptions: {
|
||||||
|
...(baseLibConfig.build?.rollupOptions || {}),
|
||||||
|
external: (id) => deps.some((dep) => id.startsWith(dep))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"singleQuote": true,
|
|
||||||
"printWidth": 80,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": false,
|
|
||||||
"trailingComma": "all",
|
|
||||||
"bracketSpacing": true,
|
|
||||||
"bracketSameLine": false,
|
|
||||||
"endOfLine": "auto",
|
|
||||||
"semi": true
|
|
||||||
}
|
|
||||||
9
docs/CHANGELOG.md
Normal file
9
docs/CHANGELOG.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# @nhost/docs
|
||||||
|
|
||||||
|
## 0.0.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 584976d: - publishable directory structure changes (ESM, CJS and UMD included in the output)
|
||||||
|
- build system improvements
|
||||||
|
- fixed some bundling concerns (https://github.com/nhost/nhost/issues/428)
|
||||||
@@ -43,7 +43,7 @@ In your serverless function, you need to make sure the request actually comes fr
|
|||||||
- Check the header in the serverless function. It should match the environment variable `NHOST_WEBHOOK_SECRET`.
|
- Check the header in the serverless function. It should match the environment variable `NHOST_WEBHOOK_SECRET`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
export default function async handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
|
|
||||||
// Check webhook secret to make sure the request is valid
|
// Check webhook secret to make sure the request is valid
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: signUp()
|
|||||||
sidebar_label: signUp()
|
sidebar_label: signUp()
|
||||||
slug: /reference/javascript/auth/sign-up
|
slug: /reference/javascript/auth/sign-up
|
||||||
description: Use `signUp` to sign up users using email an password.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L93
|
||||||
---
|
---
|
||||||
|
|
||||||
# `signUp()`
|
# `signUp()`
|
||||||
@@ -12,7 +12,7 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
Use `signUp` to sign up users using email an password.
|
Use `signUp` to sign up users using email an password.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
auth.signIn({ email, password }) // email password
|
auth.signUp({ email, password }) // email password
|
||||||
```
|
```
|
||||||
|
|
||||||
## Parameters
|
## Parameters
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: signIn()
|
|||||||
sidebar_label: signIn()
|
sidebar_label: signIn()
|
||||||
slug: /reference/javascript/auth/sign-in
|
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.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L153
|
||||||
---
|
---
|
||||||
|
|
||||||
# `signIn()`
|
# `signIn()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: signOut()
|
|||||||
sidebar_label: signOut()
|
sidebar_label: signOut()
|
||||||
slug: /reference/javascript/auth/sign-out
|
slug: /reference/javascript/auth/sign-out
|
||||||
description: Use `signOut` to sign out a user
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L328
|
||||||
---
|
---
|
||||||
|
|
||||||
# `signOut()`
|
# `signOut()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: resetPassword()
|
|||||||
sidebar_label: resetPassword()
|
sidebar_label: resetPassword()
|
||||||
slug: /reference/javascript/auth/reset-password
|
slug: /reference/javascript/auth/reset-password
|
||||||
description: Use `resetPassword` to reset a user's 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L355
|
||||||
---
|
---
|
||||||
|
|
||||||
# `resetPassword()`
|
# `resetPassword()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: changePassword()
|
|||||||
sidebar_label: changePassword()
|
sidebar_label: changePassword()
|
||||||
slug: /reference/javascript/auth/change-password
|
slug: /reference/javascript/auth/change-password
|
||||||
description: Use `changePassword` to change a user's 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L380
|
||||||
---
|
---
|
||||||
|
|
||||||
# `changePassword()`
|
# `changePassword()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: sendVerificationEmail()
|
|||||||
sidebar_label: sendVerificationEmail()
|
sidebar_label: sendVerificationEmail()
|
||||||
slug: /reference/javascript/auth/send-verification-email
|
slug: /reference/javascript/auth/send-verification-email
|
||||||
description: Use `sendVerificationEmail` to send a verification email to the specified 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L406
|
||||||
---
|
---
|
||||||
|
|
||||||
# `sendVerificationEmail()`
|
# `sendVerificationEmail()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: changeEmail()
|
|||||||
sidebar_label: changeEmail()
|
sidebar_label: changeEmail()
|
||||||
slug: /reference/javascript/auth/change-email
|
slug: /reference/javascript/auth/change-email
|
||||||
description: Use `changeEmail` to change a user's 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L433
|
||||||
---
|
---
|
||||||
|
|
||||||
# `changeEmail()`
|
# `changeEmail()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: deanonymize()
|
|||||||
sidebar_label: deanonymize()
|
sidebar_label: deanonymize()
|
||||||
slug: /reference/javascript/auth/deanonymize
|
slug: /reference/javascript/auth/deanonymize
|
||||||
description: Use `deanonymize` to deanonymize a user
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L458
|
||||||
---
|
---
|
||||||
|
|
||||||
# `deanonymize()`
|
# `deanonymize()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: onTokenChanged()
|
|||||||
sidebar_label: onTokenChanged()
|
sidebar_label: onTokenChanged()
|
||||||
slug: /reference/javascript/auth/on-token-changed
|
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.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L492
|
||||||
---
|
---
|
||||||
|
|
||||||
# `onTokenChanged()`
|
# `onTokenChanged()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: onAuthStateChanged()
|
|||||||
sidebar_label: onAuthStateChanged()
|
sidebar_label: onAuthStateChanged()
|
||||||
slug: /reference/javascript/auth/on-auth-state-changed
|
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.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L529
|
||||||
---
|
---
|
||||||
|
|
||||||
# `onAuthStateChanged()`
|
# `onAuthStateChanged()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: isAuthenticated()
|
|||||||
sidebar_label: isAuthenticated()
|
sidebar_label: isAuthenticated()
|
||||||
slug: /reference/javascript/auth/is-authenticated
|
slug: /reference/javascript/auth/is-authenticated
|
||||||
description: Use `isAuthenticated` to check if the user is authenticated or not.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L569
|
||||||
---
|
---
|
||||||
|
|
||||||
# `isAuthenticated()`
|
# `isAuthenticated()`
|
||||||
@@ -12,9 +12,9 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
Use `isAuthenticated` to check if the user is authenticated or not.
|
Use `isAuthenticated` to check if the user is authenticated or not.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const = auth.isAuthenticated();
|
const isAuthenticated = auth.isAuthenticated()
|
||||||
|
|
||||||
if (authenticated) {
|
if (isAuthenticated) {
|
||||||
console.log('User is authenticated');
|
console.log('User is authenticated')
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: isAuthenticatedAsync()
|
|||||||
sidebar_label: isAuthenticatedAsync()
|
sidebar_label: isAuthenticatedAsync()
|
||||||
slug: /reference/javascript/auth/is-authenticated-async
|
slug: /reference/javascript/auth/is-authenticated-async
|
||||||
description: Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L587
|
||||||
---
|
---
|
||||||
|
|
||||||
# `isAuthenticatedAsync()`
|
# `isAuthenticatedAsync()`
|
||||||
@@ -12,9 +12,9 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
|
Use `isAuthenticatedAsync` to wait and check if the user is authenticated or not.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const isAuthenticated = awiat auth.isAuthenticatedAsync();
|
const isAuthenticated = await auth.isAuthenticatedAsync()
|
||||||
|
|
||||||
if (isAuthenticated) {
|
if (isAuthenticated) {
|
||||||
console.log('User is authenticated');
|
console.log('User is authenticated')
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getAuthenticationStatus()
|
|||||||
sidebar_label: getAuthenticationStatus()
|
sidebar_label: getAuthenticationStatus()
|
||||||
slug: /reference/javascript/auth/get-authentication-status
|
slug: /reference/javascript/auth/get-authentication-status
|
||||||
description: Use `getAuthenticationStatus` to get the authentication status of the user.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L614
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getAuthenticationStatus()`
|
# `getAuthenticationStatus()`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ sidebar_label: getJWTToken()
|
|||||||
slug: /reference/javascript/auth/get-jwt-token
|
slug: /reference/javascript/auth/get-jwt-token
|
||||||
sidebar_class_name: deprecated
|
sidebar_class_name: deprecated
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L615
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L628
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getJWTToken()`
|
# `getJWTToken()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getAccessToken()
|
|||||||
sidebar_label: getAccessToken()
|
sidebar_label: getAccessToken()
|
||||||
slug: /reference/javascript/auth/get-access-token
|
slug: /reference/javascript/auth/get-access-token
|
||||||
description: Use `getAccessToken` to get the logged in user's 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L642
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getAccessToken()`
|
# `getAccessToken()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getDecodedAccessToken()
|
|||||||
sidebar_label: getDecodedAccessToken()
|
sidebar_label: getDecodedAccessToken()
|
||||||
slug: /reference/javascript/auth/get-decoded-access-token
|
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)
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L650
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getDecodedAccessToken()`
|
# `getDecodedAccessToken()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getHasuraClaims()
|
|||||||
sidebar_label: getHasuraClaims()
|
sidebar_label: getHasuraClaims()
|
||||||
slug: /reference/javascript/auth/get-hasura-claims
|
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)
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L660
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getHasuraClaims()`
|
# `getHasuraClaims()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getHasuraClaim()
|
|||||||
sidebar_label: getHasuraClaim()
|
sidebar_label: getHasuraClaim()
|
||||||
slug: /reference/javascript/auth/get-hasura-claim
|
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)
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L670
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getHasuraClaim()`
|
# `getHasuraClaim()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: refreshSession()
|
|||||||
sidebar_label: refreshSession()
|
sidebar_label: refreshSession()
|
||||||
slug: /reference/javascript/auth/refresh-session
|
slug: /reference/javascript/auth/refresh-session
|
||||||
description: Use `refreshSession()` to refresh the current session or refresh the session with an provided `refreshToken`.
|
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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L689
|
||||||
---
|
---
|
||||||
|
|
||||||
# `refreshSession()`
|
# `refreshSession()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getSession()
|
|||||||
sidebar_label: getSession()
|
sidebar_label: getSession()
|
||||||
slug: /reference/javascript/auth/get-session
|
slug: /reference/javascript/auth/get-session
|
||||||
description: Use `getSession()` to get the current 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L733
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getSession()`
|
# `getSession()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: getUser()
|
|||||||
sidebar_label: getUser()
|
sidebar_label: getUser()
|
||||||
slug: /reference/javascript/auth/get-user
|
slug: /reference/javascript/auth/get-user
|
||||||
description: Use `getUser()` to get the current 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
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L748
|
||||||
---
|
---
|
||||||
|
|
||||||
# `getUser()`
|
# `getUser()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: HasuraAuthClient
|
|||||||
sidebar_label: Auth
|
sidebar_label: Auth
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
slug: /reference/javascript/auth
|
slug: /reference/javascript/auth
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L64
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L51
|
||||||
---
|
---
|
||||||
|
|
||||||
# `HasuraAuthClient`
|
# `HasuraAuthClient`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiChangeEmailResponse
|
|||||||
sidebar_label: ApiChangeEmailResponse
|
sidebar_label: ApiChangeEmailResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L170
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L166
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiChangeEmailResponse`
|
# `ApiChangeEmailResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiChangePasswordResponse
|
|||||||
sidebar_label: ApiChangePasswordResponse
|
sidebar_label: ApiChangePasswordResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L162
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L158
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiChangePasswordResponse`
|
# `ApiChangePasswordResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiDeanonymizeResponse
|
|||||||
sidebar_label: ApiDeanonymizeResponse
|
sidebar_label: ApiDeanonymizeResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L174
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L170
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiDeanonymizeResponse`
|
# `ApiDeanonymizeResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
---
|
|
||||||
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
|
||||||
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`
|
|
||||||
|
|
||||||
## 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`
|
|
||||||
|
|
||||||
---
|
|
||||||
@@ -4,13 +4,13 @@ title: ApiRefreshTokenResponse
|
|||||||
sidebar_label: ApiRefreshTokenResponse
|
sidebar_label: ApiRefreshTokenResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L150
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L146
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiRefreshTokenResponse`
|
# `ApiRefreshTokenResponse`
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type ApiRefreshTokenResponse =
|
type ApiRefreshTokenResponse =
|
||||||
| { session: null; error: ApiError }
|
| { session: null; error: ErrorPayload }
|
||||||
| { session: Session; error: null }
|
| { session: Session; error: null }
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiResetPasswordResponse
|
|||||||
sidebar_label: ApiResetPasswordResponse
|
sidebar_label: ApiResetPasswordResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L158
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L154
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiResetPasswordResponse`
|
# `ApiResetPasswordResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiSendVerificationEmailResponse
|
|||||||
sidebar_label: ApiSendVerificationEmailResponse
|
sidebar_label: ApiSendVerificationEmailResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L166
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L162
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiSendVerificationEmailResponse`
|
# `ApiSendVerificationEmailResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiSignInData
|
|||||||
sidebar_label: ApiSignInData
|
sidebar_label: ApiSignInData
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L135
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiSignInData`
|
# `ApiSignInData`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiSignInResponse
|
|||||||
sidebar_label: ApiSignInResponse
|
sidebar_label: ApiSignInResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L143
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L139
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiSignInResponse`
|
# `ApiSignInResponse`
|
||||||
@@ -12,5 +12,5 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
```ts
|
```ts
|
||||||
type ApiSignInResponse =
|
type ApiSignInResponse =
|
||||||
| { data: ApiSignInData; error: null }
|
| { data: ApiSignInData; error: null }
|
||||||
| { data: null; error: ApiError }
|
| { data: null; error: ErrorPayload }
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ApiSignOutResponse
|
|||||||
sidebar_label: ApiSignOutResponse
|
sidebar_label: ApiSignOutResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L154
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L150
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiSignOutResponse`
|
# `ApiSignOutResponse`
|
||||||
@@ -13,6 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ title: ApiSignUpEmailPasswordResponse
|
|||||||
sidebar_label: ApiSignUpEmailPasswordResponse
|
sidebar_label: ApiSignUpEmailPasswordResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L135
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L131
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ApiSignUpEmailPasswordResponse`
|
# `ApiSignUpEmailPasswordResponse`
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type ApiSignUpEmailPasswordResponse =
|
type ApiSignUpEmailPasswordResponse =
|
||||||
| { session: null; error: ApiError }
|
| { session: null; error: ErrorPayload }
|
||||||
| { session: Session; error: null }
|
| { session: Session; error: null }
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: AuthChangeEvent
|
|||||||
sidebar_label: AuthChangeEvent
|
sidebar_label: AuthChangeEvent
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L117
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L113
|
||||||
---
|
---
|
||||||
|
|
||||||
# `AuthChangeEvent`
|
# `AuthChangeEvent`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: AuthChangedFunction
|
|||||||
sidebar_label: AuthChangedFunction
|
sidebar_label: AuthChangedFunction
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L119
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L115
|
||||||
---
|
---
|
||||||
|
|
||||||
# `AuthChangedFunction`
|
# `AuthChangedFunction`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ChangeEmailParams
|
|||||||
sidebar_label: ChangeEmailParams
|
sidebar_label: ChangeEmailParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L91
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L87
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ChangeEmailParams`
|
# `ChangeEmailParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ChangePasswordParams
|
|||||||
sidebar_label: ChangePasswordParams
|
sidebar_label: ChangePasswordParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L82
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L78
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ChangePasswordParams`
|
# `ChangePasswordParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: DeanonymizeParams
|
|||||||
sidebar_label: DeanonymizeParams
|
sidebar_label: DeanonymizeParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L97
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L93
|
||||||
---
|
---
|
||||||
|
|
||||||
# `DeanonymizeParams`
|
# `DeanonymizeParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: Headers
|
|||||||
sidebar_label: Headers
|
sidebar_label: Headers
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L128
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L124
|
||||||
---
|
---
|
||||||
|
|
||||||
# `Headers`
|
# `Headers`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: LoginData
|
|||||||
sidebar_label: LoginData
|
sidebar_label: LoginData
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L123
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L119
|
||||||
---
|
---
|
||||||
|
|
||||||
# `LoginData`
|
# `LoginData`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: Mfa
|
|||||||
sidebar_label: Mfa
|
sidebar_label: Mfa
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L131
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L127
|
||||||
---
|
---
|
||||||
|
|
||||||
# `Mfa`
|
# `Mfa`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: NhostAuthConstructorParams
|
|||||||
sidebar_label: NhostAuthConstructorParams
|
sidebar_label: NhostAuthConstructorParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L14
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L15
|
||||||
---
|
---
|
||||||
|
|
||||||
# `NhostAuthConstructorParams`
|
# `NhostAuthConstructorParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: OnTokenChangedFunction
|
|||||||
sidebar_label: OnTokenChangedFunction
|
sidebar_label: OnTokenChangedFunction
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L121
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L117
|
||||||
---
|
---
|
||||||
|
|
||||||
# `OnTokenChangedFunction`
|
# `OnTokenChangedFunction`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: ResetPasswordParams
|
|||||||
sidebar_label: ResetPasswordParams
|
sidebar_label: ResetPasswordParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L77
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L73
|
||||||
---
|
---
|
||||||
|
|
||||||
# `ResetPasswordParams`
|
# `ResetPasswordParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SendVerificationEmailParams
|
|||||||
sidebar_label: SendVerificationEmailParams
|
sidebar_label: SendVerificationEmailParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L86
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L82
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SendVerificationEmailParams`
|
# `SendVerificationEmailParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: Session
|
|||||||
sidebar_label: Session
|
sidebar_label: Session
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L21
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L22
|
||||||
---
|
---
|
||||||
|
|
||||||
# `Session`
|
# `Session`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInEmailPasswordParams
|
|||||||
sidebar_label: SignInEmailPasswordParams
|
sidebar_label: SignInEmailPasswordParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L46
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L42
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInEmailPasswordParams`
|
# `SignInEmailPasswordParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInParams
|
|||||||
sidebar_label: SignInParams
|
sidebar_label: SignInParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L70
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L66
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInParams`
|
# `SignInParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessEmailParams
|
|||||||
sidebar_label: SignInPasswordlessEmailParams
|
sidebar_label: SignInPasswordlessEmailParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L51
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L47
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInPasswordlessEmailParams`
|
# `SignInPasswordlessEmailParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsOtpParams
|
|||||||
sidebar_label: SignInPasswordlessSmsOtpParams
|
sidebar_label: SignInPasswordlessSmsOtpParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L61
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L57
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInPasswordlessSmsOtpParams`
|
# `SignInPasswordlessSmsOtpParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInPasswordlessSmsParams
|
|||||||
sidebar_label: SignInPasswordlessSmsParams
|
sidebar_label: SignInPasswordlessSmsParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L56
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L52
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInPasswordlessSmsParams`
|
# `SignInPasswordlessSmsParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInReponse
|
|||||||
sidebar_label: SignInReponse
|
sidebar_label: SignInReponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L106
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L102
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInReponse`
|
# `SignInReponse`
|
||||||
@@ -17,7 +17,7 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-j
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<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">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignInWithProviderOptions
|
|||||||
sidebar_label: SignInWithProviderOptions
|
sidebar_label: SignInWithProviderOptions
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L65
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L61
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignInWithProviderOptions`
|
# `SignInWithProviderOptions`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignUpEmailPasswordParams
|
|||||||
sidebar_label: SignUpEmailPasswordParams
|
sidebar_label: SignUpEmailPasswordParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L33
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L29
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignUpEmailPasswordParams`
|
# `SignUpEmailPasswordParams`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: SignUpParams
|
|||||||
sidebar_label: SignUpParams
|
sidebar_label: SignUpParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L39
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L35
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignUpParams`
|
# `SignUpParams`
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ title: SignUpResponse
|
|||||||
sidebar_label: SignUpResponse
|
sidebar_label: SignUpResponse
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L41
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L37
|
||||||
---
|
---
|
||||||
|
|
||||||
# `SignUpResponse`
|
# `SignUpResponse`
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type SignUpResponse =
|
type SignUpResponse =
|
||||||
| { session: null; error: ApiError }
|
| { session: null; error: ErrorPayload }
|
||||||
| { session: Session | null; error: null }
|
| { session: Session | null; error: null }
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: NhostClient
|
|||||||
sidebar_label: NhostClient
|
sidebar_label: NhostClient
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
slug: /reference/nextjs/nhost-client
|
slug: /reference/nextjs/nhost-client
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L16
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L17
|
||||||
---
|
---
|
||||||
|
|
||||||
# `NhostClient`
|
# `NhostClient`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useAccessToken()
|
|||||||
sidebar_label: useAccessToken()
|
sidebar_label: useAccessToken()
|
||||||
slug: /reference/nextjs/use-access-token
|
slug: /reference/nextjs/use-access-token
|
||||||
description: Get the JWT access token
|
description: Get the JWT access token
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L119
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L122
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAccessToken()`
|
# `useAccessToken()`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ sidebar_label: useAuthLoading()
|
|||||||
slug: /reference/nextjs/use-auth-loading
|
slug: /reference/nextjs/use-auth-loading
|
||||||
sidebar_class_name: deprecated
|
sidebar_class_name: deprecated
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L59
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L62
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAuthLoading()`
|
# `useAuthLoading()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useAuthenticated()
|
|||||||
sidebar_label: useAuthenticated()
|
sidebar_label: useAuthenticated()
|
||||||
slug: /reference/nextjs/use-authenticated
|
slug: /reference/nextjs/use-authenticated
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L101
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L104
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAuthenticated()`
|
# `useAuthenticated()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useAuthenticationStatus()
|
|||||||
sidebar_label: useAuthenticationStatus()
|
sidebar_label: useAuthenticationStatus()
|
||||||
slug: /reference/nextjs/use-authentication-status
|
slug: /reference/nextjs/use-authentication-status
|
||||||
description: The Nhost client may need some initial steps to determine the authentication status during startup, like fetching a new JWT from an existing refresh token.
|
description: The Nhost client may need some initial steps to determine the authentication status during startup, like fetching a new JWT from an existing refresh token.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L87
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L90
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAuthenticationStatus()`
|
# `useAuthenticationStatus()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useNhostBackendUrl()
|
|||||||
sidebar_label: useNhostBackendUrl()
|
sidebar_label: useNhostBackendUrl()
|
||||||
slug: /reference/nextjs/use-nhost-backend-url
|
slug: /reference/nextjs/use-nhost-backend-url
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L45
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L48
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useNhostBackendUrl()`
|
# `useNhostBackendUrl()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useNhostClient()
|
|||||||
sidebar_label: useNhostClient()
|
sidebar_label: useNhostClient()
|
||||||
slug: /reference/nextjs/use-nhost-client
|
slug: /reference/nextjs/use-nhost-client
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L32
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L35
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useNhostClient()`
|
# `useNhostClient()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useProviderLink()
|
|||||||
sidebar_label: useProviderLink()
|
sidebar_label: useProviderLink()
|
||||||
slug: /reference/nextjs/use-provider-link
|
slug: /reference/nextjs/use-provider-link
|
||||||
description: Hook that returns OAuth provider URLs
|
description: Hook that returns OAuth provider URLs
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L393
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L485
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useProviderLink()`
|
# `useProviderLink()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useSignInAnonymous()
|
|||||||
sidebar_label: useSignInAnonymous()
|
sidebar_label: useSignInAnonymous()
|
||||||
slug: /reference/nextjs/use-sign-in-anonymous
|
slug: /reference/nextjs/use-sign-in-anonymous
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L346
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L399
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useSignInAnonymous()`
|
# `useSignInAnonymous()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useSignInEmailPassword()
|
|||||||
sidebar_label: useSignInEmailPassword()
|
sidebar_label: useSignInEmailPassword()
|
||||||
slug: /reference/nextjs/use-sign-in-email-password
|
slug: /reference/nextjs/use-sign-in-email-password
|
||||||
description: Email and Password Sign-In
|
description: Email and Password Sign-In
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L114
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L116
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useSignInEmailPassword()`
|
# `useSignInEmailPassword()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useSignInEmailPasswordless()
|
|||||||
sidebar_label: useSignInEmailPasswordless()
|
sidebar_label: useSignInEmailPasswordless()
|
||||||
slug: /reference/nextjs/use-sign-in-email-passwordless
|
slug: /reference/nextjs/use-sign-in-email-passwordless
|
||||||
description: Passwordless email authentication hook
|
description: Passwordless email authentication hook
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L284
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/authentication.ts#L308
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useSignInEmailPasswordless()`
|
# `useSignInEmailPasswordless()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useSignOut()
|
|||||||
sidebar_label: useSignOut()
|
sidebar_label: useSignOut()
|
||||||
slug: /reference/nextjs/use-sign-out
|
slug: /reference/nextjs/use-sign-out
|
||||||
description: Sign out The `useSignOut` hook accepts an `all` argument that will be used when the `signOut` method will be called. This value can be overriden in calling `signOut(allValue)`.
|
description: Sign out The `useSignOut` hook accepts an `all` argument that will be used when the `signOut` method will be called. This value can be overriden in calling `signOut(allValue)`.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L154
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L157
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useSignOut()`
|
# `useSignOut()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useSignUpEmailPassword()
|
|||||||
sidebar_label: useSignUpEmailPassword()
|
sidebar_label: useSignUpEmailPassword()
|
||||||
slug: /reference/nextjs/use-sign-up-email-password
|
slug: /reference/nextjs/use-sign-up-email-password
|
||||||
description: Email and Password Sign-Up
|
description: Email and Password Sign-Up
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/registration.ts#L104
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/registration.ts#L102
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useSignUpEmailPassword()`
|
# `useSignUpEmailPassword()`
|
||||||
|
|||||||
@@ -13,14 +13,6 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hoo
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
|
||||||
|
|
||||||
**`@returns`**
|
|
||||||
|
|
||||||
`true` if an error occurred
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
|
||||||
|
|
||||||
Provides details about the error
|
Provides details about the error
|
||||||
@@ -40,3 +32,11 @@ Provides details about the error
|
|||||||
Returns `true` if the action is successful.
|
Returns `true` if the action is successful.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
|
||||||
|
|
||||||
|
**`@depreacted`**
|
||||||
|
|
||||||
|
use `!isSuccess` or `!!error` instead
|
||||||
|
|
||||||
|
---
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: NhostNextClientConstructorParams
|
|||||||
sidebar_label: NhostNextClientConstructorParams
|
sidebar_label: NhostNextClientConstructorParams
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
displayed_sidebar: referenceSidebar
|
displayed_sidebar: referenceSidebar
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L10
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nextjs/src/index.ts#L11
|
||||||
---
|
---
|
||||||
|
|
||||||
# `NhostNextClientConstructorParams`
|
# `NhostNextClientConstructorParams`
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/pro
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**<span className="parameter-name">initial</span>** <span className="optional-status">optional</span> `NhostSession`
|
**<span className="parameter-name">initial</span>** <span className="optional-status">optional</span> [`NhostSession`](/reference/docgen/nextjs/types/nhost-session)
|
||||||
|
|
||||||
|
| Property | Type | Required | Notes |
|
||||||
|
| :------------------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">initial.</span>user</span> | `User` | ✔️ | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">initial.</span>refreshToken</span> | `string` | ✔️ | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">initial.</span>accessTokenExpiresIn</span> | `number` | ✔️ | |
|
||||||
|
| <span className="parameter-name"><span className="light-grey">initial.</span>accessToken</span> | `string` | ✔️ | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
30
docs/docs/reference/docgen/nextjs/types/nhost-session.mdx
Normal file
30
docs/docs/reference/docgen/nextjs/types/nhost-session.mdx
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
|
||||||
|
title: NhostSession
|
||||||
|
sidebar_label: NhostSession
|
||||||
|
description: No description provided.
|
||||||
|
displayed_sidebar: referenceSidebar
|
||||||
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/core/src/types.ts#L126
|
||||||
|
---
|
||||||
|
|
||||||
|
# `NhostSession`
|
||||||
|
|
||||||
|
## 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> `User`
|
||||||
|
|
||||||
|
---
|
||||||
@@ -4,7 +4,7 @@ title: useAccessToken()
|
|||||||
sidebar_label: useAccessToken()
|
sidebar_label: useAccessToken()
|
||||||
slug: /reference/react/use-access-token
|
slug: /reference/react/use-access-token
|
||||||
description: Get the JWT access token
|
description: Get the JWT access token
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L119
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L122
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAccessToken()`
|
# `useAccessToken()`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ sidebar_label: useAuthLoading()
|
|||||||
slug: /reference/react/use-auth-loading
|
slug: /reference/react/use-auth-loading
|
||||||
sidebar_class_name: deprecated
|
sidebar_class_name: deprecated
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L59
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L62
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAuthLoading()`
|
# `useAuthLoading()`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ title: useAuthenticated()
|
|||||||
sidebar_label: useAuthenticated()
|
sidebar_label: useAuthenticated()
|
||||||
slug: /reference/react/use-authenticated
|
slug: /reference/react/use-authenticated
|
||||||
description: No description provided.
|
description: No description provided.
|
||||||
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L101
|
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/hooks/common.ts#L104
|
||||||
---
|
---
|
||||||
|
|
||||||
# `useAuthenticated()`
|
# `useAuthenticated()`
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user