Compare commits

..

81 Commits

Author SHA1 Message Date
Szilárd Dóró
ebc1730fce Merge pull request #1375 from nhost/changeset-release/main
chore: update versions
2022-12-13 16:55:15 +01:00
Pierre-Louis Mercereau
c1cd1e813c docs: update changelog 2022-12-13 16:34:41 +01:00
Pierre-Louis Mercereau
e08a074474 chore: un-bump major versions 2022-12-13 16:33:30 +01:00
github-actions[bot]
95932fa3f2 chore: update versions 2022-12-13 13:06:10 +00:00
Pilou
99402b77d1 Merge pull request #1376 from nhost/chore/docgen
chore: remove generated documentation from the repository
2022-12-13 14:04:48 +01:00
Szilárd Dóró
f6fb2cd8e6 Merge pull request #1377 from nhost/fix/local-development-region
fix(dashboard): don't break the UI when project is not loaded yet
2022-12-13 13:49:38 +01:00
Szilárd Dóró
5c2cf59b41 chore(dashboard): update CHANGELOG.md 2022-12-13 13:11:50 +01:00
Szilárd Dóró
a6d31dc260 fix(dashboard): don't break the UI when project is not loaded yet 2022-12-13 13:10:54 +01:00
Pierre-Louis Mercereau
bd73557a47 Merge branch 'main' into chore/docgen 2022-12-13 12:01:04 +01:00
Pilou
c95bab70c2 Merge pull request #1366 from nhost/refactor/merge-core
refactor: decommission `@nhost/core`
2022-12-13 10:50:36 +01:00
Szilárd Dóró
52d4b5de45 Merge pull request #1347 from nhost/changeset-release/main
chore: update versions
2022-12-13 10:29:25 +01:00
Szilárd Dóró
6b4ab50f74 fix(packages): nextjs and react-apollo versions 2022-12-13 09:50:42 +01:00
github-actions[bot]
ceba605d0b chore: update versions 2022-12-13 08:47:12 +00:00
Szilárd Dóró
9249a85ee5 Merge pull request #1371 from nhost/fix/aws-name-null-reference
fix(dashboard): don't break UI when region is nullish
2022-12-13 09:45:32 +01:00
Szilárd Dóró
f4d70f88e9 chore(dashboard): add changeset 2022-12-12 22:43:06 +01:00
Szilárd Dóró
0d09b80b12 fix(dashboard): fix nullish region in local mode 2022-12-12 22:42:09 +01:00
Pierre-Louis Mercereau
195adfb04a chore: remove generated documentation from the repository 2022-12-12 21:26:21 +01:00
Pilou
b09930c8a4 Merge pull request #1369 from nhost/contributors-readme-action-TvJAKaD1lO
docs(contributor): contributors readme action update
2022-12-12 19:06:31 +01:00
github-actions[bot]
687951281e docs(contributor): contrib-readme-action has updated readme 2022-12-12 18:05:20 +00:00
Pilou
c0f05acd9b Merge pull request #1365 from badgifter/patch-windowslive-url
Windows Live Provider displayed link updated to match backend url
2022-12-12 19:05:01 +01:00
Pierre-Louis Mercereau
d8c2d369aa chore: changeset 2022-12-12 15:43:55 +01:00
Pierre-Louis Mercereau
a4e4926aeb Merge branch 'main' into refactor/merge-core 2022-12-12 15:28:26 +01:00
Pilou
4a9471cc16 Create rude-singers-carry.md 2022-12-12 14:42:55 +01:00
Bad Gifter
567e370bdc microsoft changed to windowslive 2022-12-12 14:04:35 +03:00
Bad Gifter
a91f2db0e2 Windows Live Provider displayed link updated to match backend url 2022-12-12 13:49:08 +03:00
Szilárd Dóró
aea99ad2c8 Merge pull request #1361 from nhost/fix/apple-sign-in-mutation
fix(dashboard): do not show error when submitting Apple provider settings
2022-12-09 09:45:33 +01:00
Szilárd Dóró
594488e435 chore(dashboard): add changeset 2022-12-09 09:29:32 +01:00
Szilárd Dóró
bb83b0f81a fix(dashboard): do not show error when submitting Apple provider settings 2022-12-09 09:18:46 +01:00
Pilou
0384d7c7c4 Merge pull request #1360 from nhost/contributors-readme-action-cDMbyYcNKN
docs(contributor): contributors readme action update
2022-12-08 19:40:40 +01:00
Pilou
7e356a9604 Merge pull request #1357 from nhost/contributors-readme-action-sNfze0TcKw
docs(contributor): contributors readme action update
2022-12-08 19:29:19 +01:00
github-actions[bot]
013e55a307 docs(contributor): contrib-readme-action has updated readme 2022-12-08 18:28:57 +00:00
Pilou
2a71257cde Merge pull request #1358 from nhost/fix/workspace-packages
fix: use workspace to resolve internal dependencies
2022-12-08 19:28:41 +01:00
Pierre-Louis Mercereau
583a4401d0 docs: add explanation to the CI workflow 2022-12-08 18:50:01 +01:00
Pierre-Louis Mercereau
914e91a0b0 ci: correct test 2022-12-08 18:40:49 +01:00
Pierre-Louis Mercereau
98698213e2 ci: run all e2e tests when lockfile changed 2022-12-08 18:29:54 +01:00
Pierre-Louis Mercereau
756daa97cd fix: use workspace to resolve internal dependencies 2022-12-08 16:58:47 +01:00
github-actions[bot]
ab5a2b119c docs(contributor): contrib-readme-action has updated readme 2022-12-08 15:18:12 +00:00
Johan Eliasson
ffdcce1463 Merge pull request #1352 from wollerman/patch-1
Add a section on managing local seed data
2022-12-08 16:17:54 +01:00
Szilárd Dóró
a3dcb6106e Merge pull request #1355 from nhost/chore/revert-types-react-bump
chore(dashboard): revert `@types/react` bump
2022-12-08 15:03:24 +01:00
Szilárd Dóró
208d224763 chore(dashboard): revert @types/react bump 2022-12-08 14:46:36 +01:00
Matt Wollerman
564d000bfc add link to overview description of seed data 2022-12-07 20:21:09 -05:00
Matt Wollerman
266fda07ab add a section on managing local seed data 2022-12-07 08:45:40 -05:00
Pilou
6174e1ddcc Merge pull request #1341 from nhost/refactor/nhost-react-providers
refactor: nhost react providers
2022-12-06 12:57:26 +01:00
Pierre-Louis Mercereau
af2e3eae37 chore: minor bump 2022-12-06 12:39:30 +01:00
Pilou
d2b4c126f3 Merge pull request #1346 from nhost/chore/prettier-ignore-lockfile
chore: prettier ignore pnpm-lock.yaml
2022-12-06 11:01:00 +01:00
Pierre-Louis Mercereau
7f2e182c47 chore: prettier ignore pnpm-lock.yaml 2022-12-06 10:54:16 +01:00
Szilárd Dóró
ae40bd54d4 Merge pull request #1302 from nhost/renovate/react-18.x
chore(deps): update dependency @types/react to v18.0.26
2022-12-06 10:01:27 +01:00
Pilou
b5cc47078a Update .changeset/big-pumpkins-march.md
Co-authored-by: Szilárd Dóró <doroszilard@icloud.com>
2022-12-06 09:59:25 +01:00
Pierre-Louis Mercereau
7f251111e2 chore: 🤖 changeset 2022-12-06 09:41:40 +01:00
Pierre-Louis Mercereau
c03dacc3a3 refactor: use NhostProvider in React and Nextjs 2022-12-06 09:39:44 +01:00
Pilou
8b9e1a0ce8 Merge pull request #1339 from nhost/contributors-readme-action-oSzExU64y7
docs(contributor): contributors readme action update
2022-12-06 07:04:10 +01:00
github-actions[bot]
cf9cfec330 docs(contributor): contrib-readme-action has updated readme 2022-12-06 05:52:28 +00:00
Pilou
1c94f56c59 Merge pull request #1338 from iangabrielsanchez/patch-1
Fix typo
2022-12-06 06:52:14 +01:00
Ian Gabriel Sanchez
f06d5deba3 Fix typo 2022-12-06 10:15:59 +08:00
renovate[bot]
2a86b8876c chore(deps): update dependency @types/react to v18.0.26 2022-12-05 14:47:07 +00:00
Pierre-Louis Mercereau
2764a1c4b6 Merge branch 'main' into refactor/merge-core 2022-12-05 12:17:21 +01:00
Pierre-Louis Mercereau
a0901914ac Merge branch 'main' into refactor/merge-core 2022-12-02 16:09:32 +01:00
Pierre-Louis Mercereau
26d577d7ae Merge branch 'main' into refactor/merge-core 2022-11-30 11:43:30 +01:00
Pierre-Louis Mercereau
622c48a94b chore: update changeset 2022-11-29 16:18:18 +01:00
Pierre-Louis Mercereau
e1a87a05b1 chore: update lock file 2022-11-29 16:15:49 +01:00
Pierre-Louis Mercereau
2148317282 Merge branch 'main' into refactor/merge-core 2022-11-29 16:15:05 +01:00
Pierre-Louis Mercereau
5f9c6c8346 Merge branch 'main' into refactor/merge-core 2022-11-28 21:16:06 +01:00
Pierre-Louis Mercereau
57db5b83d4 chore: 🤖 changeset 2022-11-28 15:39:21 +01:00
Pierre-Louis Mercereau
3cab18713a Merge branch 'main' into refactor/merge-core 2022-11-24 17:33:18 +01:00
Pierre-Louis Mercereau
fb94dae43a chore: merge main 2022-11-24 17:17:04 +01:00
Pierre-Louis Mercereau
f694846eae chore: 🤖 remove hasura-storage-js to hasura-auth-js 2022-11-24 16:54:13 +01:00
Pierre-Louis Mercereau
322ab50138 Merge branch 'main' into refactor/merge-core 2022-11-22 09:52:45 +01:00
Pierre-Louis Mercereau
435efd2bc5 fix: 🐛 Set same-site cookie to lax 2022-11-21 15:22:05 +01:00
Szilárd Dóró
5501a5937e fix(docgen): complex types in markdown tables 2022-11-16 12:27:24 +01:00
Pierre-Louis Mercereau
80a6808a82 Merge branch 'main' into refactor/merge-core 2022-11-16 10:26:11 +01:00
Pierre-Louis Mercereau
987bd70312 Merge branch 'main' into refactor/merge-core 2022-11-15 14:14:58 +01:00
Pierre-Louis Mercereau
feb22e62c1 fix: add missing oauth provider: azuread 2022-11-14 23:48:45 +01:00
Pierre-Louis Mercereau
e7d4c77a6d refactor: 💡 restructure hasura-auth-js after the core merger 2022-11-14 23:20:49 +01:00
Pierre-Louis Mercereau
628e32464d Merge branch 'main' into refactor/merge-core 2022-11-14 21:45:05 +01:00
Pierre-Louis Mercereau
dc82043254 chore: only include the auth client typedoc 2022-11-09 22:13:20 +01:00
Pierre-Louis Mercereau
997e9d58a8 refactor: 💡 remove @nhost/core 2022-11-09 22:09:17 +01:00
Pierre-Louis Mercereau
8a3f1706fe chore: add auth as a dependency to storage 2022-11-09 22:01:11 +01:00
Pierre-Louis Mercereau
12cbe4d534 chore: lint 2022-11-09 21:52:15 +01:00
Pierre-Louis Mercereau
9f21931201 refactor: copy tests from core 2022-11-09 21:46:32 +01:00
Pierre-Louis Mercereau
09351e1910 Merge branch 'main' into refactor/merge-core 2022-11-09 20:49:33 +01:00
Pierre-Louis Mercereau
1c2ea5a407 refactor: 💡 merge @nhost/core 2022-11-09 20:49:13 +01:00
641 changed files with 5653 additions and 14589 deletions

View File

@@ -36,13 +36,23 @@ jobs:
TURBO_TOKEN: ${{ env.TURBO_TOKEN }}
TURBO_TEAM: ${{ env.TURBO_TEAM }}
BUILD: 'all'
- name: Check if the pnpm lockfile changed
id: changed-lockfile
uses: tj-actions/changed-files@v34
with:
files: pnpm-lock.yaml
# * Determine a pnpm filter argument for packages that have been modified.
# * If the lockfile has changed, we don't filter anything in order to run all the e2e tests.
- name: filter packages
id: filter-packages
if: steps.changed-lockfile.outputs.any_changed != 'true' && github.event_name == 'pull_request'
run: echo "filter=${{ format('--filter=...[origin/{0}]', github.base_ref) }}" >> $GITHUB_OUTPUT
# * List packagesthat has an `e2e` script, except the root, and return an array of their name and path
# * In a PR, only include packages that have been modified, and their dependencies
- name: List examples with an e2e script
id: set-matrix
run: |
FILTER_MODIFIED="${{ github.event_name == 'pull_request' && format('--filter=...[origin/{0}]', github.base_ref) || '' }}"
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' $FILTER_MODIFIED \
PACKAGES=$(pnpm recursive list --depth -1 --parseable --filter='!nhost-root' ${{ steps.filter-packages.outputs.filter }} \
| xargs -I@ realpath --relative-to=$PWD @ \
| xargs -I@ jq "if (.scripts.e2e | length) != 0 then {name: .name, path: \"@\"} else null end" @/package.json \
| awk "!/null/" \

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
prefer-workspace-packages = true

View File

@@ -14,4 +14,5 @@ package.json
tsconfig.json
tsconfig.*.json
*.d.ts
.next
.next
**/pnpm-lock.yaml

View File

@@ -258,21 +258,28 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Subhendu Kundu</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/badgifter">
<img src="https://avatars.githubusercontent.com/u/50094885?v=4" width="100;" alt="badgifter"/>
<br />
<sub><b>Bad Gifter</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/heygambo">
<img src="https://avatars.githubusercontent.com/u/449438?v=4" width="100;" alt="heygambo"/>
<br />
<sub><b>Christian Gambardella</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/dbarrosop">
<img src="https://avatars.githubusercontent.com/u/6246622?v=4" width="100;" alt="dbarrosop"/>
<br />
<sub><b>David Barroso</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/hajek-raven">
<img src="https://avatars.githubusercontent.com/u/7288737?v=4" width="100;" alt="hajek-raven"/>
@@ -294,13 +301,21 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Jerry Jäppinen</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/wollerman">
<img src="https://avatars.githubusercontent.com/u/1610241?v=4" width="100;" alt="wollerman"/>
<br />
<sub><b>Matt Wollerman</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mdp18">
<img src="https://avatars.githubusercontent.com/u/11698527?v=4" width="100;" alt="mdp18"/>
<br />
<sub><b>Max</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/mustafa-hanif">
<img src="https://avatars.githubusercontent.com/u/30019262?v=4" width="100;" alt="mustafa-hanif"/>
@@ -314,8 +329,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Nicolas Bourdin</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/piromsurang">
<img src="https://avatars.githubusercontent.com/u/17776837?v=4" width="100;" alt="piromsurang"/>
@@ -343,7 +357,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Muttenzer</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/alexander-mart">
<img src="https://avatars.githubusercontent.com/u/14993551?v=4" width="100;" alt="alexander-mart"/>
@@ -357,8 +372,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Amir Ahmic</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/akd-io">
<img src="https://avatars.githubusercontent.com/u/30059155?v=4" width="100;" alt="akd-io"/>
@@ -386,7 +400,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Chris Wetherell</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/rustyb">
<img src="https://avatars.githubusercontent.com/u/53086?v=4" width="100;" alt="rustyb"/>
@@ -400,8 +415,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Dago</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/dminkovsky">
<img src="https://avatars.githubusercontent.com/u/218725?v=4" width="100;" alt="dminkovsky"/>
@@ -429,7 +443,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Helio Alves</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/nkhdo">
<img src="https://avatars.githubusercontent.com/u/26102306?v=4" width="100;" alt="nkhdo"/>
@@ -437,14 +452,20 @@ Here are some ways of contributing to making Nhost better:
<sub><b>Hoang Do</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/iangabrielsanchez">
<img src="https://avatars.githubusercontent.com/u/9511946?v=4" width="100;" alt="iangabrielsanchez"/>
<br />
<sub><b>Ian Gabriel Sanchez</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/eltociear">
<img src="https://avatars.githubusercontent.com/u/22633385?v=4" width="100;" alt="eltociear"/>
<br />
<sub><b>Ikko Ashimine</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/jladuval">
<img src="https://avatars.githubusercontent.com/u/1935359?v=4" width="100;" alt="jladuval"/>
@@ -465,7 +486,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Lucas Bois</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/MarcelloTheArcane">
<img src="https://avatars.githubusercontent.com/u/21159570?v=4" width="100;" alt="MarcelloTheArcane"/>
@@ -486,8 +508,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Nirmalya Ghosh</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/quentin-decre">
<img src="https://avatars.githubusercontent.com/u/1137511?v=4" width="100;" alt="quentin-decre"/>
@@ -508,7 +529,8 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Simon Altschuler</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/atapas">
<img src="https://avatars.githubusercontent.com/u/3633137?v=4" width="100;" alt="atapas"/>
@@ -529,8 +551,7 @@ Here are some ways of contributing to making Nhost better:
<br />
<sub><b>Vadim</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/TheRedLancer">
<img src="https://avatars.githubusercontent.com/u/58493767?v=4" width="100;" alt="TheRedLancer"/>

View File

@@ -19,7 +19,9 @@ module.exports = {
'*.spec.ts',
'*.spec.tsx',
'tests/**/*.ts',
'tests/**/*.d.ts'
'tests/**/*.d.ts',
'e2e/**/*.ts',
'e2e/**/*.d.ts'
],
plugins: ['@typescript-eslint', 'cypress'],
extends: ['plugin:cypress/recommended'],

View File

@@ -1,6 +1,4 @@
module.exports = {
'(packages|integrations)/(docgen|hasura-auth-js|hasura-storage-js|nextjs|nhost-js|react|core|vue)/src/**/*.{js,ts,jsx,tsx}':
['pnpm docgen', 'git add docs'],
'(nhost-cloud.yaml|**/nhost/config.yaml)': () => [
'pnpm sync-versions',
"git add ':(glob)**/nhost/config.yaml'"

View File

@@ -28,22 +28,47 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"sourceMap": true,
"types": ["node"],
"types": [
"node"
],
"typeRoots": [
"./node_modules/@types", "**/*/dist", "**/*/build", "**/*/.next", "**/*/umd"
"./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"],
"@nhost/vue": ["../packages/vue/src/index.ts"]
"@nhost/apollo": [
"../packages/apollo/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"
],
"@nhost/vue": [
"../packages/vue/src/index.ts"
]
}
},
"exclude": [

View File

@@ -1,5 +1,37 @@
# @nhost/dashboard
## 0.7.10
### Patch Changes
- Updated dependencies [57db5b83]
- @nhost/nextjs@1.11.0
- @nhost/nhost-js@1.7.0
- @nhost/react@0.17.0
- @nhost/react-apollo@4.11.0
## 0.7.9
### Patch Changes
- a6d31dc2: fix(dashboard): don't break the UI when project is not loaded yet
## 0.7.8
### Patch Changes
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
`NhostReactProvider` and `NhostNextProvider` are now deprecated
- f4d70f88: fix(dashboard): do not break when region is nullish
- 4a9471cc: Windows Live Provider displayed link updated to match backend url
- 594488e4: fix(dashboard): do not show error when submitting Apple provider settings
- Updated dependencies [7f251111]
- @nhost/nextjs@1.10.0
- @nhost/react@0.16.0
- @nhost/react-apollo@4.10.0
## 0.7.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.7.7",
"version": "0.7.10",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -34,7 +34,6 @@
"@mui/material": "^5.10.14",
"@mui/system": "^5.10.14",
"@mui/x-date-pickers": "^5.0.8",
"@nhost/core": "workspace:*",
"@nhost/nextjs": "workspace:*",
"@nhost/nhost-js": "workspace:*",
"@nhost/react": "workspace:*",

View File

@@ -5,6 +5,9 @@ import Image from 'next/image';
export default function OverviewProjectInfo() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { region, subdomain } = currentApplication || {};
const isRegionAvailable =
region?.awsName && region?.countryCode && region?.city;
return (
<div className="grid grid-flow-row content-start gap-6">
@@ -16,28 +19,28 @@ export default function OverviewProjectInfo() {
<div className="grid grid-flow-row gap-3">
<InfoCard
title="Region"
value={currentApplication.region?.awsName}
value={region?.awsName}
customValue={
currentApplication.region && (
region.countryCode &&
region.city && (
<div className="grid grid-flow-col items-center gap-1 self-center">
<Image
src={`/assets/${currentApplication.region.countryCode}.svg`}
alt={`Logo of ${currentApplication.region.countryCode}`}
src={`/assets/${region.countryCode}.svg`}
alt={`Logo of ${region.countryCode}`}
width={16}
height={16}
/>
<Text className="text-sm font-medium text-greyscaleDark">
{currentApplication.region.city} (
{currentApplication.region.awsName})
{region.city} ({region.awsName})
</Text>
</div>
)
}
disableCopy={!currentApplication.region}
disableCopy={!isRegionAvailable}
/>
<InfoCard title="Subdomain" value={currentApplication.subdomain} />
<InfoCard title="Subdomain" value={subdomain} />
</div>
)}
</div>

View File

@@ -23,7 +23,6 @@ export interface AppleProviderFormValues {
authAppleKeyId: string;
authAppleClientId: string;
authApplePrivateKey: string;
authAppleScope: string;
}
export default function AppleProviderSettings() {
@@ -38,7 +37,6 @@ export default function AppleProviderSettings() {
authAppleKeyId,
authAppleClientId,
authApplePrivateKey,
authAppleScope,
},
},
loading,
@@ -57,7 +55,6 @@ export default function AppleProviderSettings() {
authAppleKeyId,
authAppleClientId,
authApplePrivateKey,
authAppleScope,
authAppleEnabled,
},
});
@@ -83,9 +80,7 @@ export default function AppleProviderSettings() {
const updateAppMutation = updateApp({
variables: {
id: currentApplication.id,
app: {
...values,
},
app: values,
},
});
@@ -96,7 +91,7 @@ export default function AppleProviderSettings() {
success: `Apple settings have been updated successfully.`,
error: `An error occurred while trying to update the project's Apple settings.`,
},
{ ...toastStyleProps },
toastStyleProps,
);
form.reset(values);
@@ -108,9 +103,11 @@ export default function AppleProviderSettings() {
<SettingsContainer
title="Apple"
description="Allow users to sign in with Apple."
primaryActionButtonProps={{
disabled: !formState.isValid || !formState.isDirty,
loading: formState.isSubmitting,
slotProps={{
submitButton: {
disabled: !formState.isValid || !formState.isDirty,
loading: formState.isSubmitting,
},
}}
docsLink="https://docs.nhost.io/authentication/sign-in-with-apple"
docsTitle="how to sign in users with Apple"
@@ -134,9 +131,9 @@ export default function AppleProviderSettings() {
hideEmptyHelperText
/>
<Input
{...register('authAppleScope')}
name="authAppleScope"
id="authAppleScope"
{...register('authAppleClientId')}
name="authAppleClientId"
id="authAppleClientId"
label="Service ID"
placeholder="Apple Service ID"
className="col-span-1"

View File

@@ -115,7 +115,7 @@ export default function WindowsLiveProviderSettings() {
currentApplication.subdomain,
currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/microsoft/callback`}
)}/v1/signin/provider/windowslive/callback`}
disabled
endAdornment={
<InputAdornment position="end" className="absolute right-2">
@@ -130,7 +130,7 @@ export default function WindowsLiveProviderSettings() {
currentApplication.subdomain,
currentApplication.region.awsName,
'auth',
)}/v1/signin/provider/microsoft/callback`,
)}/v1/signin/provider/windowslive/callback`,
'Redirect URL',
);
}}

View File

@@ -42,7 +42,12 @@ export function useCurrentWorkspaceAndApplication(): UseCurrentWorkspaceAndAppli
],
deployments: [],
subdomain: 'localhost',
region: null,
region: {
id: null,
countryCode: null,
city: null,
awsName: null,
},
isProvisioned: true,
createdAt: new Date().toISOString(),
desiredState: ApplicationStatus.Live,

View File

@@ -21,7 +21,7 @@ import '@fontsource/roboto-mono/400.css';
import '@fontsource/roboto-mono/500.css';
import { ThemeProvider } from '@mui/material';
import CssBaseline from '@mui/material/CssBaseline';
import { NhostNextProvider } from '@nhost/nextjs';
import { NhostProvider } from '@nhost/nextjs';
import { NhostApolloProvider } from '@nhost/react-apollo';
import * as snippet from '@segment/snippet';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
@@ -89,7 +89,7 @@ function MyApp({
<QueryClientProvider client={queryClient}>
<CacheProvider value={emotionCache}>
<NhostNextProvider nhost={nhost}>
<NhostProvider nhost={nhost}>
<NhostApolloProvider
fetchPolicy="cache-first"
nhost={nhost}
@@ -118,7 +118,7 @@ function MyApp({
</UserDataProvider>
</WorkspaceProvider>
</NhostApolloProvider>
</NhostNextProvider>
</NhostProvider>
</CacheProvider>
</QueryClientProvider>
</ErrorBoundary>

View File

@@ -1,10 +1,12 @@
import CheckIcon from '@/ui/v2/icons/CheckIcon';
import XIcon from '@/ui/v2/icons/XIcon';
import type { DefaultToastOptions } from 'react-hot-toast';
/**
* Common styles for `toast.promise` notifications in the settings page.
* @see {@link https://react-hot-toast.com/docs/toast}
*/
export const toastStyleProps = {
export const toastStyleProps: DefaultToastOptions = {
style: {
minWidth: '400px',
backgroundColor: 'rgb(33 50 75)',
@@ -12,7 +14,11 @@ export const toastStyleProps = {
},
success: {
duration: 5000,
icon: <CheckIcon className="h-4 w-4 bg-transparent" />,
icon: <CheckIcon className="h-4 w-4" />,
},
error: {
duration: 5000,
icon: <XIcon className="h-4 w-4" />,
},
};

View File

@@ -7,7 +7,7 @@ import { UserDataProvider } from '@/context/workspace1-context';
import defaultTheme from '@/theme/default';
import { CacheProvider } from '@emotion/react';
import { ThemeProvider } from '@mui/material/styles';
import { NhostNextProvider } from '@nhost/nextjs';
import { NhostProvider } from '@nhost/nextjs';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { queries, Queries, RenderOptions } from '@testing-library/react';
import { render as rtlRender } from '@testing-library/react';
@@ -25,7 +25,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
<RetryableErrorBoundary>
<QueryClientProvider client={queryClient}>
<CacheProvider value={emotionCache}>
<NhostNextProvider nhost={nhost}>
<NhostProvider nhost={nhost}>
<WorkspaceProvider>
<UserDataProvider>
<ManagedUIContext>
@@ -36,7 +36,7 @@ function Providers({ children }: PropsWithChildren<{}>) {
</ManagedUIContext>
</UserDataProvider>
</WorkspaceProvider>
</NhostNextProvider>
</NhostProvider>
</CacheProvider>
</QueryClientProvider>
</RetryableErrorBoundary>

View File

@@ -17,7 +17,6 @@
"@/generated/*": ["utils/__generated__/*"],
"@/ui/*": ["components/ui/*"],
"@/ui": ["components/ui/index.ts"],
"@nhost/core": ["../../packages/core/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"],

1
docs/.gitignore vendored
View File

@@ -19,3 +19,4 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vercel
docs/reference/docgen

View File

@@ -1,5 +1,13 @@
# @nhost/docs
## 0.0.8
### Patch Changes
- 7f251111: Use `NhostProvider` instead of `NhostReactProvider` and `NhostNextProvider`
`NhostReactProvider` and `NhostNextProvider` are now deprecated
## 0.0.7
### Patch Changes

View File

@@ -33,7 +33,7 @@ Follow this guide to sign in users with LinkedIn.
- Click on **Auth** in the top menu.
- Click on the **pen icon** under **OAuth 2.0 settings** and right next to **Authorized redirect URLs for your app**.
- Click **Add redirect URL**.
- Copy and past the **OAuth Callback URL** from Nhost.
- Copy and paste the **OAuth Callback URL** from Nhost.
- Click **Update**.
## Configure Nhost

View File

@@ -325,6 +325,18 @@ curl http://localhost:1337/v1/functions/time\?name\=Greg
Hello Greg! It's now: Wed, 27 Apr 2022 18:52:12 GMT
```
## 4. Managing Local Data
Nhost makes it easy to manage data on different branches. Within your project directory there is an `.nhost` directory that tracks database configuration, database seeds, mail data, and functions.
### Seed Data
See [the section on seed data](https://docs.nhost.io/database#seed-data) for an overview.
If seeds have been applied there will be a file `seeds.applied` within the `.nhost/data/<branch-name>/db` directory.
If you need to re-apply your seeds, delete this file and restart nhost.
## Deploy your project
To deploy your local changes to production, you can commit and push them to

View File

@@ -118,7 +118,7 @@ yarn add @nhost/react @nhost/nextjs graphql
Next, open your `_app.js` file as we'll now configure Nhost inside our app.
The Nhost Next.js SDK comes with a React provider named `NhostNextProvider` that
The Nhost Next.js SDK comes with a React provider named `NhostProvider` that
makes the authentication state and all the provided React hooks available in our
application.
@@ -128,7 +128,7 @@ Nhost backend:
```jsx title="pages/_app.js"
import { UserProvider } from '../UserProvider';
// highlight-start
import { NhostNextProvider, NhostClient } from '@nhost/nextjs';
import { NhostProvider, NhostClient } from '@nhost/nextjs';
// highlight-end
// highlight-start
@@ -141,12 +141,12 @@ const nhost = new NhostClient({
function MyApp({ Component, pageProps }) {
return (
{/* highlight-next-line */}
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
<UserProvider>
{/* ... */}
</UserProvider>
{/* highlight-next-line */}
</NhostNextProvider>
</NhostProvider>
);
}
```
@@ -561,9 +561,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
function MyApp({ Component, pageProps }) {
return (
<NhostNextProvider nhost={nhost} initial={pageProps.nhostSession}>
<NhostProvider nhost={nhost} initial={pageProps.nhostSession}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostNextProvider>
</NhostProvider>
)
}
```

View File

@@ -118,7 +118,7 @@ yarn add @nhost/react graphql
Next, open your `App.js` file as we'll now configure Nhost inside our app.
The Nhost React SDK comes with a React provider named `NhostReactProvider` that
The Nhost React SDK comes with a React provider named `NhostProvider` that
makes the authentication state and all the provided React hooks available in our
application.
@@ -126,7 +126,7 @@ Use the following code to instantiate a new Nhost client and link it to your
Nhost backend:
```jsx title="src/App.js"
import { NhostClient, NhostReactProvider } from '@nhost/react'
import { NhostClient, NhostProvider } from '@nhost/react'
const nhost = new NhostClient({
subdomain: process.env.REACT_APP_NHOST_SUBDOMAIN,
@@ -135,9 +135,9 @@ const nhost = new NhostClient({
function App() {
return (
<NhostReactProvider nhost={nhost}>
<NhostProvider nhost={nhost}>
<BrowserRouter>{/* ... */}</BrowserRouter>
</NhostReactProvider>
</NhostProvider>
)
}
@@ -443,7 +443,7 @@ import ProtectedRoute from './components/ProtectedRoute'
function App() {
return (
<NhostReactProvider nhost={nhost}>
<NhostProvider nhost={nhost}>
<BrowserRouter>
<Routes>
<Route path="sign-up" element={<SignUp />} />
@@ -463,7 +463,7 @@ function App() {
</Route>
</Routes>
</BrowserRouter>
</NhostReactProvider>
</NhostProvider>
)
}
```
@@ -527,9 +527,9 @@ import { NhostApolloProvider } from '@nhost/react-apollo'
function App() {
return (
<NhostReactProvider nhost={nhost}>
<NhostProvider nhost={nhost}>
<NhostApolloProvider nhost={nhost}>{/* ... */}</NhostApolloProvider>
</NhostReactProvider>
</NhostProvider>
)
}
```

View File

@@ -1,3 +0,0 @@
{
"label": "Auth"
}

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: activateMfaPromise()
sidebar_label: activateMfaPromise()
slug: /reference/javascript/auth/activate-mfa-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L44
---
# `activateMfaPromise()`
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta&lt;Typegen0, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ServiceMap&gt;&gt;</code>
---
**<span className="parameter-name">code</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: addSecurityKeyPromise()
sidebar_label: addSecurityKeyPromise()
slug: /reference/javascript/auth/add-security-key-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/addSecurityKey.ts#L19
---
# `addSecurityKeyPromise()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onStart()
sidebar_label: onStart()
slug: /reference/javascript/auth/auth-cookie-client/on-start
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/internal-client.ts#L74
---
# `onStart()`
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> <code>(client: AuthClient) =&gt; void</code>
---

View File

@@ -0,0 +1,23 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthCookieClient
sidebar_label: AuthCookieClient
description: No description provided.
sidebar_class_name: deprecated
slug: /reference/javascript/auth/auth-cookie-client
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/internal-client.ts#L87
---
# `AuthCookieClient`
:::caution Deprecated
Not in use anymore. Use `clientStorageType: 'cookie'` instead
:::
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>Omit&lt;NhostClientOptions, "clientStorageGetter" &#124; "clientStorageSetter" &#124; "clientStorageType" &#124; "clientStorage"&gt;</code>
---

View File

@@ -0,0 +1,30 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changeEmailPromise()
sidebar_label: changeEmailPromise()
slug: /reference/javascript/auth/change-email-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changeEmail.ts#L11
---
# `changeEmailPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangeEmailContext, any, { type: "REQUEST", email: string, options: ChangeEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: ChangeEmailContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", email: string, options: ChangeEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ChangeEmailServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ChangeEmailOptions`](/reference/docgen/javascript/auth/types/change-email-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changePasswordPromise()
sidebar_label: changePasswordPromise()
slug: /reference/javascript/auth/change-password-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changePassword.ts#L11
---
# `changePasswordPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangePasswordContext, any, { type: "REQUEST", password: string, ticket: string } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: ChangePasswordContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", password: string, ticket: string } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ChangePasswordServices&gt;&gt;</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,29 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createAuthMachine()
sidebar_label: createAuthMachine()
slug: /reference/javascript/auth/create-auth-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/machine.ts#L84
---
# `createAuthMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`AuthMachineOptions`](/reference/docgen/javascript/auth/types/auth-machine-options)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientUrl</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | <code>boolean</code> | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | <code>boolean</code> | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | <code>boolean</code> | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage) | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type) | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | <code>number</code> | | Time interval until token refreshes, in seconds |
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createChangeEmailMachine()
sidebar_label: createChangeEmailMachine()
slug: /reference/javascript/auth/create-change-email-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-email.ts#L28
---
# `createChangeEmailMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createChangePasswordMachine()
sidebar_label: createChangePasswordMachine()
slug: /reference/javascript/auth/create-change-password-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-password.ts#L27
---
# `createChangePasswordMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createEnableMfaMachine()
sidebar_label: createEnableMfaMachine()
slug: /reference/javascript/auth/create-enable-mfa-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/enable-mfa.ts#L30
---
# `createEnableMfaMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createResetPasswordMachine()
sidebar_label: createResetPasswordMachine()
slug: /reference/javascript/auth/create-reset-password-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/reset-password.ts#L27
---
# `createResetPasswordMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: createSendVerificationEmailMachine()
sidebar_label: createSendVerificationEmailMachine()
slug: /reference/javascript/auth/create-send-verification-email-machine
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/send-verification-email.ts#L27
---
# `createSendVerificationEmailMachine()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: encodeQueryParameters()
sidebar_label: encodeQueryParameters()
slug: /reference/javascript/auth/encode-query-parameters
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L3
---
# `encodeQueryParameters()`
## Parameters
---
**<span className="parameter-name">baseUrl</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">parameters</span>** <span className="optional-status">optional</span> <code>Record&lt;string, unknown&gt;</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: generateQrCodePromise()
sidebar_label: generateQrCodePromise()
slug: /reference/javascript/auth/generate-qr-code-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L23
---
# `generateQrCodePromise()`
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta&lt;Typegen0, { type: "GENERATE" } &#124; { type: "ACTIVATE", code: string, activeMfaType: "totp" } &#124; { type: "GENERATED" } &#124; { type: "GENERATED_ERROR", error: null &#124; ErrorPayload } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ServiceMap&gt;&gt;</code>
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAuthenticationResult()
sidebar_label: getAuthenticationResult()
slug: /reference/javascript/auth/get-authentication-result
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/client-helpers.ts#L23
---
# `getAuthenticationResult()`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SessionActionHandlerResult`](/reference/docgen/javascript/auth/types/session-action-handler-result)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- | :------: | :------------------------------------------ |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>accessToken</span> | <code>null &#124; string</code> | ✔️ | Access token (JWT) |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>user</span> | <code>null &#124; [`User`](/reference/docgen/javascript/auth/types/user)</code> | ✔️ | User information |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isSuccess</span> | <code>boolean</code> | ✔️ | Returns `true` if the action is successful. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>error</span> | <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code> | ✔️ | Provides details about the error |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isError</span> | <code>boolean</code> | ✔️ | |
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getParameterByName()
sidebar_label: getParameterByName()
slug: /reference/javascript/auth/get-parameter-by-name
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L65
---
# `getParameterByName()`
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">url</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,28 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getSession()
sidebar_label: getSession()
slug: /reference/javascript/auth/get-session
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/client-helpers.ts#L5
---
# `getSession()`
## Parameters
---
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/docgen/javascript/auth/types/auth-context)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial&lt;Record&lt;StateErrorTypes, ErrorPayload&gt;&gt;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>{ value: string &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>{ startedAt: Date &#124; null, attempts: number, lastAttempt: Date &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>{ value: string &#124; null, expiresAt: Date &#124; null }</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>{ ticket: string } &#124; null</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/docgen/javascript/auth/types/user) &#124; null</code> | ✔️ | |
---

View File

@@ -1,49 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signUp()
sidebar_label: signUp()
slug: /reference/javascript/auth/sign-up
description: Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L117
---
# `signUp()`
Use `nhost.auth.signUp` to sign up a user using email and password. If you want to sign up a user using passwordless email (Magic Link), SMS, or an OAuth provider, use the `signIn` function instead.
```ts
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignUpParams`](/reference/docgen/javascript/auth/types/sign-up-params)
---
## Examples
### Sign up with an email and password
```ts
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign up with a security key
```ts
nhost.auth.signUp({
email: 'joe@example.com',
securityKey: true
})
@docs https://docs.nhost.io/reference/javascript/auth/sign-up
```

View File

@@ -1,84 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signIn()
sidebar_label: signIn()
slug: /reference/javascript/auth/sign-in
description: Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user 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#L187
---
# `signIn()`
Use `nhost.auth.signIn` to sign in a user using email and password, passwordless (email or sms) or an external provider. `signIn` can be used to sign in a user in various ways depending on the parameters.
```ts
nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> [`SignInParams`](/reference/docgen/javascript/auth/types/sign-in-params)
---
## Examples
### Sign in a user using email and password
```ts
nhost.auth.signIn({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign in a user using an OAuth provider (e.g: Google or Facebook)
```ts
nhost.auth.signIn({ provider: 'google' })
```
### Sign in a user using passwordless email (Magic Link)
```ts
nhost.auth.signIn({ email: 'joe@example.com' })
```
### Sign in a user using passwordless SMS
```ts
// [step 1/2] Passwordless sign in using SMS
nhost.auth.signIn({ phoneNumber: '+11233213123' })
// [step 2/2] Finish passwordless sign in using SMS (OTP)
nhost.auth.signIn({ phoneNumber: '+11233213123', otp: '123456' })
```
### Sign in anonymously
```ts
// Sign in anonymously
nhost.auth.signIn()
// Later in the application, the user can complete their registration
nhost.auth.signUp({
email: 'joe@example.com',
password: 'secret-password'
})
```
### Sign in with a security key
```ts
nhost.auth.signIn({
email: 'joe@example.com',
securityKey: true
})
@docs https://docs.nhost.io/reference/javascript/auth/sign-in
```

View File

@@ -1,38 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signOut()
sidebar_label: signOut()
slug: /reference/javascript/auth/sign-out
description: Use `nhost.auth.signOut` to sign out the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L287
---
# `signOut()`
Use `nhost.auth.signOut` to sign out the user.
```ts
nhost.auth.signOut()
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">optional</span> `{ all: boolean }`
---
## Examples
### Sign out the user from current device
```ts
nhost.auth.signOut()
```
### Sign out the user from all devices
```ts
nhost.auth.signOut({ all: true })
```

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: resetPassword()
sidebar_label: resetPassword()
slug: /reference/javascript/auth/reset-password
description: Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L303
---
# `resetPassword()`
Use `nhost.auth.resetPassword` to reset the password for a user. This will send a reset-password link in an email to the user. When the user clicks the reset-password link the user is automatically signed-in. Once signed-in, the user can change their password using `nhost.auth.changePassword()`.
```ts
nhost.auth.resetPassword({ email: 'joe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ResetPasswordParams`](/reference/docgen/javascript/auth/types/reset-password-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changePassword()
sidebar_label: changePassword()
slug: /reference/javascript/auth/change-password
description: Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L319
---
# `changePassword()`
Use `nhost.auth.changePassword` to change the password for the signed-in user. The old password is not needed. In case the user is not signed-in, a password reset ticket needs to be provided.
```ts
nhost.auth.changePassword({ newPassword: 'new-secret-password' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangePasswordParams`](/reference/docgen/javascript/auth/types/change-password-params)
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------- | :------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newPassword</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>ticket</span> | `string` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: sendVerificationEmail()
sidebar_label: sendVerificationEmail()
slug: /reference/javascript/auth/send-verification-email
description: Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L338
---
# `sendVerificationEmail()`
Use `nhost.auth.sendVerificationEmail` to send a verification email to the specified email. The email contains a verification-email link. When the user clicks the verification-email link their email is verified.
```ts
nhost.auth.sendVerificationEmail({ email: 'joe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SendVerificationEmailParams`](/reference/docgen/javascript/auth/types/send-verification-email-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>email</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: changeEmail()
sidebar_label: changeEmail()
slug: /reference/javascript/auth/change-email
description: Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L357
---
# `changeEmail()`
Use `nhost.auth.changeEmail` to change a user's email. This will send a confirm-email-change link in an email to the new email. Once the user clicks on the confirm-email-change link the email will be change to the new email.
```ts
nhost.auth.changeEmail({ newEmail: 'doe@example.com' })
```
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`ChangeEmailParams`](/reference/docgen/javascript/auth/types/change-email-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------- | :--------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>newEmail</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>options</span> | `RedirectOption` | | |
---

View File

@@ -1,27 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: deanonymize()
sidebar_label: deanonymize()
slug: /reference/javascript/auth/deanonymize
description: Use `nhost.auth.deanonymize` to deanonymize a user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L373
---
# `deanonymize()`
Use `nhost.auth.deanonymize` to deanonymize a user.
```ts
nhost.auth.deanonymize({
signInMethod: 'email-password',
email: 'joe@example.com'
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`DeanonymizeParams`](/reference/docgen/javascript/auth/types/deanonymize-params)
---

View File

@@ -1,22 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: addSecurityKey()
sidebar_label: addSecurityKey()
slug: /reference/javascript/auth/add-security-key
description: Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L411
---
# `addSecurityKey()`
Use `nhost.auth.addSecurityKey to add a security key to the user, using the WebAuthn API.
## Parameters
---
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> `string`
optional human-readable nickname for the security key
---

View File

@@ -1,26 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onTokenChanged()
sidebar_label: onTokenChanged()
slug: /reference/javascript/auth/on-token-changed
description: Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L429
---
# `onTokenChanged()`
Use `nhost.auth.onTokenChanged` to add a custom function that runs every time the access or refresh token is changed.
```ts
nhost.auth.onTokenChanged(() =>
console.log('The access and refresh token has changed')
)
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`OnTokenChangedFunction`](/reference/docgen/javascript/auth/types/on-token-changed-function)
---

View File

@@ -1,28 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: onAuthStateChanged()
sidebar_label: onAuthStateChanged()
slug: /reference/javascript/auth/on-auth-state-changed
description: Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L464
---
# `onAuthStateChanged()`
Use `nhost.auth.onAuthStateChanged` to add a custom function that runs every time the authentication status of the user changes. E.g. add a custom function that runs every time the authentication status changes from signed-in to signed-out.
```ts
nhost.auth.onAuthStateChanged((event, session) => {
console.log(
`The auth state has changed. State is now ${event} with session: ${session}`
)
})
```
## Parameters
---
**<span className="parameter-name">fn</span>** <span className="optional-status">required</span> [`AuthChangedFunction`](/reference/docgen/javascript/auth/types/auth-changed-function)
---

View File

@@ -1,27 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isAuthenticated()
sidebar_label: isAuthenticated()
slug: /reference/javascript/auth/is-authenticated
description: Use `nhost.auth.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#L506
---
# `isAuthenticated()`
Use `nhost.auth.isAuthenticated` to check if the user is authenticated or not.
Note: `nhost.auth.isAuthenticated()` can return `false` for two reasons:
1. The user is not authenticated
2. The user is not authenticated but _might_ be authenticated soon (loading) because there is a network request in transit.
Use `nhost.auth.getAuthenticationStatus` to get both authentication and loading status.
```ts
const isAuthenticated = nhost.auth.isAuthenticated()
if (isAuthenticated) {
console.log('User is authenticated')
}
```

View File

@@ -1,23 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isAuthenticatedAsync()
sidebar_label: isAuthenticatedAsync()
slug: /reference/javascript/auth/is-authenticated-async
description: Use `nhost.auth.isAuthenticatedAsync` to wait (await) for any internal authentication network requests to finish and then return the authentication status.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L527
---
# `isAuthenticatedAsync()`
Use `nhost.auth.isAuthenticatedAsync` to wait (await) for any internal authentication network requests to finish and then return the authentication status.
The promise won't resolve until the authentication status is known.
Attention: when using auto-signin and a refresh token is present in the client storage, the promise won't resolve if the server can't be reached (e.g. offline) or if it returns an internal error.
```ts
const isAuthenticated = await nhost.auth.isAuthenticatedAsync()
if (isAuthenticated) {
console.log('User is authenticated')
}
```

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAuthenticationStatus()
sidebar_label: getAuthenticationStatus()
slug: /reference/javascript/auth/get-authentication-status
description: Use `nhost.auth.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#L555
---
# `getAuthenticationStatus()`
Use `nhost.auth.getAuthenticationStatus` to get the authentication status of the user.
If `isLoading` is `true`, the client doesn't know whether the user is authenticated yet or not
because some internal authentication network requests have not been resolved yet.
The `connectionAttempts` returns the number of times the client has tried to connect to the server with no success (offline, or the server retruned an internal error).
```ts
const { isAuthenticated, isLoading } = nhost.auth.getAuthenticationStatus()
if (isLoading) {
console.log('Loading...')
}
if (isAuthenticated) {
console.log('User is authenticated')
}
```

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getAccessToken()
sidebar_label: getAccessToken()
slug: /reference/javascript/auth/get-access-token
description: Use `nhost.auth.getAccessToken` to get the access token of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L592
---
# `getAccessToken()`
Use `nhost.auth.getAccessToken` to get the access token of the user.
```ts
const accessToken = nhost.auth.getAccessToken()
```

View File

@@ -1,20 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getDecodedAccessToken()
sidebar_label: getDecodedAccessToken()
slug: /reference/javascript/auth/get-decoded-access-token
description: Use `nhost.auth.getDecodedAccessToken` to get the decoded access token of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L607
---
# `getDecodedAccessToken()`
Use `nhost.auth.getDecodedAccessToken` to get the decoded access token of the user.
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/| Hasura documentation}
```ts
const decodedAccessToken = nhost.auth.getDecodedAccessToken()
```

View File

@@ -1,20 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getHasuraClaims()
sidebar_label: getHasuraClaims()
slug: /reference/javascript/auth/get-hasura-claims
description: Use `nhost.auth.getHasuraClaims` to get the Hasura claims of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L624
---
# `getHasuraClaims()`
Use `nhost.auth.getHasuraClaims` to get the Hasura claims of the user.
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/| Hasura documentation}
```ts
const hasuraClaims = nhost.auth.getHasuraClaims()
```

View File

@@ -1,31 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getHasuraClaim()
sidebar_label: getHasuraClaim()
slug: /reference/javascript/auth/get-hasura-claim
description: Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L642
---
# `getHasuraClaim()`
Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of the user.
**`@see`**
{@link https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt/| Hasura documentation}
```ts
// if `x-hasura-company-id` exists as a custom claim
const companyId = nhost.auth.getHsauraClaim('company-id')
```
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> `string`
Name of the variable. You don't have to specify `x-hasura-`.
---

View File

@@ -1,30 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: refreshSession()
sidebar_label: refreshSession()
slug: /reference/javascript/auth/refresh-session
description: Use `nhost.auth.refreshSession` to refresh the session with either the current internal refresh token or an external refresh token.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L665
---
# `refreshSession()`
Use `nhost.auth.refreshSession` to refresh the session with either the current internal refresh token or an external refresh token.
Note: The Nhost client automatically refreshes the session when the user is authenticated but `nhost.auth.refreshSession` can be useful in some special cases.
```ts
// Refresh the session with the the current internal refresh token.
nhost.auth.refreshToken()
// Refresh the session with an external refresh token.
nhost.auth.refreshToken(refreshToken)
```
## Parameters
---
**<span className="parameter-name">refreshToken</span>** <span className="optional-status">optional</span> `string`
---

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getSession()
sidebar_label: getSession()
slug: /reference/javascript/auth/get-session
description: Use `nhost.auth.getSession()` to get the session of the user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L706
---
# `getSession()`
Use `nhost.auth.getSession()` to get the session of the user.
```ts
const session = nhost.auth.getSession()
```

View File

@@ -1,16 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: getUser()
sidebar_label: getUser()
slug: /reference/javascript/auth/get-user
description: Use `nhost.auth.getUser()` to get the signed-in user.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L721
---
# `getUser()`
Use `nhost.auth.getUser()` to get the signed-in user.
```ts
const user = nhost.auth.getUser()
```

View File

@@ -1,29 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: HasuraAuthClient
sidebar_label: Auth
description: No description provided.
slug: /reference/javascript/auth
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/hasura-auth-client.ts#L65
---
# `HasuraAuthClient`
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`NhostAuthConstructorParams`](/reference/docgen/javascript/auth/types/nhost-auth-constructor-params)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>url</span> | `string` | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>start</span> | `boolean` | | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | `boolean` | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | `boolean` | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | `boolean` | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | `ClientStorage` | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | `ClientStorageType` | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | `number` | | Time interval until token refreshes, in seconds |
---

View File

@@ -1,10 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: useConfigMfa()
sidebar_label: useConfigMfa()
slug: /reference/nextjs/use-config-mfa
title: isBrowser()
sidebar_label: isBrowser()
slug: /reference/javascript/auth/is-browser
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useConfigMfa.ts#L22
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/environment.ts#L1
---
# `useConfigMfa()`
# `isBrowser()`

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isValidEmail()
sidebar_label: isValidEmail()
slug: /reference/javascript/auth/is-valid-email
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/validators.ts#L3
---
# `isValidEmail()`
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isValidPassword()
sidebar_label: isValidPassword()
slug: /reference/javascript/auth/is-valid-password
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/validators.ts#L12
---
# `isValidPassword()`
## Parameters
---
**<span className="parameter-name">password</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isValidPhoneNumber()
sidebar_label: isValidPhoneNumber()
slug: /reference/javascript/auth/is-valid-phone-number
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/validators.ts#L16
---
# `isValidPhoneNumber()`
## Parameters
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: isValidTicket()
sidebar_label: isValidTicket()
slug: /reference/javascript/auth/is-valid-ticket
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/validators.ts#L19
---
# `isValidTicket()`
## Parameters
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -0,0 +1,36 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: localStorageGetter()
sidebar_label: localStorageGetter()
slug: /reference/javascript/auth/local-storage-getter
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/local-storage.ts#L30
---
# `localStorageGetter()`
## Parameters
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type)
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null &#124; string) =&gt; void &#124; Promise&lt;void&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) =&gt; null &#124; string &#124; Promise&lt;null &#124; string&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) =&gt; void</code> | | |
---

View File

@@ -0,0 +1,36 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: localStorageSetter()
sidebar_label: localStorageSetter()
slug: /reference/javascript/auth/local-storage-setter
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/local-storage.ts#L74
---
# `localStorageSetter()`
## Parameters
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type)
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) =&gt; null &#124; string &#124; Promise&lt;null &#124; string&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null &#124; string) =&gt; void &#124; Promise&lt;void&gt;</code> | | |
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: nhostApiClient()
sidebar_label: nhostApiClient()
slug: /reference/javascript/auth/nhost-api-client
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/axios.ts#L6
---
# `nhostApiClient()`
## Parameters
---
**<span className="parameter-name">backendUrl</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: removeParameterFromWindow()
sidebar_label: removeParameterFromWindow()
slug: /reference/javascript/auth/remove-parameter-from-window
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L81
---
# `removeParameterFromWindow()`
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,30 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: resetPasswordPromise()
sidebar_label: resetPasswordPromise()
slug: /reference/javascript/auth/reset-password-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/resetPassword.ts#L15
---
# `resetPasswordPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ResetPasswordContext, any, { type: "REQUEST", email: string, options: ResetPasswordOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: ResetPasswordContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", email: string, options: ResetPasswordOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, ResetPasswordServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ResetPasswordOptions`](/reference/docgen/javascript/auth/types/reset-password-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -0,0 +1,31 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: rewriteRedirectTo()
sidebar_label: rewriteRedirectTo()
slug: /reference/javascript/auth/rewrite-redirect-to
description: Transform options that include a redirectTo property so the redirect url is absolute, given a base clientUrl. If no client url is given, any relative redirectUrl is removed while the other options are sent as-is.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/url.ts#L29
---
# `rewriteRedirectTo()`
Transform options that include a redirectTo property so the
redirect url is absolute, given a base clientUrl.
If no client url is given, any relative redirectUrl is removed while
the other options are sent as-is.
**`@returns`**
## Parameters
---
**<span className="parameter-name">clientUrl</span>** <span className="optional-status">optional</span> <code>string</code>
base client url
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> <code>T</code>
---

View File

@@ -0,0 +1,30 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: sendVerificationEmailPromise()
sidebar_label: sendVerificationEmailPromise()
slug: /reference/javascript/auth/send-verification-email-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/sendVerificationEmail.ts#L17
---
# `sendVerificationEmailPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;SendVerificationEmailContext, any, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, { value: any, context: SendVerificationEmailContext }, ResolveTypegenMeta&lt;Typegen0, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } &#124; { type: "SUCCESS" } &#124; { type: "ERROR", error: null &#124; ErrorPayload }, BaseActionObject, SendVerificationEmailServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SendVerificationEmailOptions`](/reference/docgen/javascript/auth/types/send-verification-email-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -0,0 +1,18 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInAnonymousPromise()
sidebar_label: signInAnonymousPromise()
slug: /reference/javascript/auth/sign-in-anonymous-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInAnonymous.ts#L9
---
# `signInAnonymousPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInEmailPasswordPromise()
sidebar_label: signInEmailPasswordPromise()
slug: /reference/javascript/auth/sign-in-email-password-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInEmailPassword.ts#L23
---
# `signInEmailPasswordPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,35 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInEmailPasswordlessPromise()
sidebar_label: signInEmailPasswordlessPromise()
slug: /reference/javascript/auth/sign-in-email-passwordless-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInEmailPasswordless.ts#L13
---
# `signInEmailPasswordlessPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/docgen/javascript/auth/types/passwordless-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInEmailSecurityKeyPromise()
sidebar_label: signInEmailSecurityKeyPromise()
slug: /reference/javascript/auth/sign-in-email-security-key-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInEmailSecurityKey.ts#L18
---
# `signInEmailSecurityKeyPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInMfaTotpPromise()
sidebar_label: signInMfaTotpPromise()
slug: /reference/javascript/auth/sign-in-mfa-totp-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInMfaTotp.ts#L10
---
# `signInMfaTotpPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -0,0 +1,26 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInSmsPasswordlessOtpPromise()
sidebar_label: signInSmsPasswordlessOtpPromise()
slug: /reference/javascript/auth/sign-in-sms-passwordless-otp-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInSmsPasswordlessOtp.ts#L11
---
# `signInSmsPasswordlessOtpPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -0,0 +1,35 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signInSmsPasswordlessPromise()
sidebar_label: signInSmsPasswordlessPromise()
slug: /reference/javascript/auth/sign-in-sms-passwordless-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signInSmsPasswordless.ts#L18
---
# `signInSmsPasswordlessPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/docgen/javascript/auth/types/passwordless-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signOutPromise()
sidebar_label: signOutPromise()
slug: /reference/javascript/auth/sign-out-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signOut.ts#L9
---
# `signOutPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">all</span>** <span className="optional-status">optional</span> <code>boolean</code>
---

View File

@@ -0,0 +1,39 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signUpEmailPasswordPromise()
sidebar_label: signUpEmailPasswordPromise()
slug: /reference/javascript/auth/sign-up-email-password-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signUpEmailPassword.ts#L19
---
# `signUpEmailPasswordPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpOptions`](/reference/docgen/javascript/auth/types/sign-up-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -0,0 +1,36 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: signUpEmailSecurityKeyPromise()
sidebar_label: signUpEmailSecurityKeyPromise()
slug: /reference/javascript/auth/sign-up-email-security-key-promise
description: No description provided.
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/signUpEmailSecurityKey.ts#L19
---
# `signUpEmailSecurityKeyPromise()`
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, { value: any, context: AuthContext }, ResolveTypegenMeta&lt;Typegen0, { type: "SESSION_UPDATE", data: { session: NhostSession } } &#124; { type: "TRY_TOKEN", token: string } &#124; { type: "SIGNIN_ANONYMOUS" } &#124; { type: "SIGNIN_SECURITY_KEY_EMAIL", email: string } &#124; { type: "SIGNIN_PASSWORD", email: string, password: string } &#124; { type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions } &#124; { type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string } &#124; { type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions } &#124; { type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions } &#124; { type: "SIGNOUT", all: boolean } &#124; { type: "SIGNIN_MFA_TOTP", ticket: string, otp: string } &#124; { type: "SIGNED_IN" } &#124; { type: "SIGNED_OUT" } &#124; { type: "TOKEN_CHANGED" } &#124; { type: "AWAIT_EMAIL_VERIFICATION" }, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpSecurityKeyOptions`](/reference/docgen/javascript/auth/types/sign-up-security-key-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>nickname</span> | <code>string</code> | | Optional nickname for the security key |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -1,9 +0,0 @@
{
"label": "Types",
"position": 1,
"className": "hidden",
"link": {
"type": "generated-index",
"slug": "/reference/docgen/javascript/auth/types"
}
}

View File

@@ -0,0 +1,32 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ActionErrorState
sidebar_label: ActionErrorState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/types.ts#L3
---
# `ActionErrorState`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
Provides details about the error
---

View File

@@ -0,0 +1,22 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ActionLoadingState
sidebar_label: ActionLoadingState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/types.ts#L13
---
# `ActionLoadingState`
## Parameters
---
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` when the action is executing, `false` when it finished its execution.
---

View File

@@ -0,0 +1,20 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ActionSuccessState
sidebar_label: ActionSuccessState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/types.ts#L20
---
# `ActionSuccessState`
## Parameters
---
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> <code>boolean</code>
Returns `true` if the action is successful.
---

View File

@@ -0,0 +1,36 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ActivateMfaHandlerResult
sidebar_label: ActivateMfaHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L15
---
# `ActivateMfaHandlerResult`
## Parameters
---
**<span className="parameter-name">isActivated</span>** <span className="optional-status">required</span> <code>boolean</code>
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
Provides details about the error
---

View File

@@ -0,0 +1,40 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ActivateMfaState
sidebar_label: ActivateMfaState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/mfa.ts#L19
---
# `ActivateMfaState`
## Parameters
---
**<span className="parameter-name">isActivated</span>** <span className="optional-status">required</span> <code>boolean</code>
---
**<span className="parameter-name">isActivating</span>** <span className="optional-status">required</span> <code>boolean</code>
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
Provides details about the error
---

View File

@@ -0,0 +1,47 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AddSecurityKeyHandlerResult
sidebar_label: AddSecurityKeyHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/addSecurityKey.ts#L13
---
# `AddSecurityKeyHandlerResult`
## Parameters
---
**<span className="parameter-name">key</span>** <span className="optional-status">optional</span> [`SecurityKey`](/reference/docgen/javascript/auth/types/security-key)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------- | :------------------ | :------: | :------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">key.</span>id</span> | <code>string</code> | ✔️ | Unique indentifier of the security key |
| <span className="parameter-name"><span className="light-grey">key.</span>nickname</span> | <code>string</code> | | Human-readable nickname fof the security key |
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
Provides details about the error
---
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> <code>boolean</code>
Returns `true` if the action is successful.
---

View File

@@ -0,0 +1,55 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AddSecurityKeyState
sidebar_label: AddSecurityKeyState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/addSecurityKey.ts#L17
---
# `AddSecurityKeyState`
## Parameters
---
**<span className="parameter-name">key</span>** <span className="optional-status">optional</span> [`SecurityKey`](/reference/docgen/javascript/auth/types/security-key)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------- | :------------------ | :------: | :------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">key.</span>id</span> | <code>string</code> | ✔️ | Unique indentifier of the security key |
| <span className="parameter-name"><span className="light-grey">key.</span>nickname</span> | <code>string</code> | | Human-readable nickname fof the security key |
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an error occurred
**`@depreacted`**
use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
Provides details about the error
---
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` when the action is executing, `false` when it finished its execution.
---
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> <code>boolean</code>
Returns `true` if the action is successful.
---

View File

@@ -1,14 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthChangeEvent
sidebar_label: AuthChangeEvent
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L118
---
# `AuthChangeEvent`
```ts
type AuthChangeEvent = 'SIGNED_IN' | 'SIGNED_OUT'
```

View File

@@ -1,17 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthChangedFunction
sidebar_label: AuthChangedFunction
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L120
---
# `AuthChangedFunction`
```ts
type AuthChangedFunction = () => (
event: AuthChangeEvent,
session: NhostSession | null
) => void
```

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthContext
sidebar_label: AuthContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/context.ts#L5
---
# `AuthContext`
```ts
type AuthContext = () => { errors: Partial<Record<StateErrorTypes, ErrorPayload>>, importTokenAttempts: number, refreshToken: { value: string | null }, refreshTimer: { startedAt: Date | null, attempts: number, lastAttempt: Date | null }, accessToken: { value: string | null, expiresAt: Date | null }, mfa: { ticket: string } | null, user: [User](/reference/docgen/javascript/auth/types/user) | null }
```

View File

@@ -0,0 +1,43 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthEvents
sidebar_label: AuthEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/events.ts#L8
---
# `AuthEvents`
```ts
type AuthEvents =
| { type: 'SESSION_UPDATE'; data: { session: NhostSession } }
| { type: 'TRY_TOKEN'; token: string }
| { type: 'SIGNIN_ANONYMOUS' }
| { type: 'SIGNIN_SECURITY_KEY_EMAIL'; email: string }
| { type: 'SIGNIN_PASSWORD'; email: string; password: string }
| { type: 'PASSWORDLESS_EMAIL'; email: string; options: PasswordlessOptions }
| {
type: 'PASSWORDLESS_SMS'
phoneNumber: string
options: PasswordlessOptions
}
| { type: 'PASSWORDLESS_SMS_OTP'; phoneNumber: string; otp: string }
| {
type: 'SIGNUP_EMAIL_PASSWORD'
email: string
password: string
options: SignUpOptions
}
| {
type: 'SIGNUP_SECURITY_KEY'
email: string
options: SignUpSecurityKeyOptions
}
| { type: 'SIGNOUT'; all: boolean }
| { type: 'SIGNIN_MFA_TOTP'; ticket: string; otp: string }
| { type: 'SIGNED_IN' }
| { type: 'SIGNED_OUT' }
| { type: 'TOKEN_CHANGED' }
| { type: 'AWAIT_EMAIL_VERIFICATION' }
```

View File

@@ -1,14 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: BackendUrl
sidebar_label: BackendUrl
title: AuthInterpreter
sidebar_label: AuthInterpreter
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/nhost-js/src/utils/types.ts#L7
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/machine.ts#L67
---
# `BackendUrl`
```ts
type BackendUrl = () => { backendUrl: string }
```
# `AuthInterpreter`

View File

@@ -0,0 +1,88 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthMachineOptions
sidebar_label: AuthMachineOptions
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/machine.ts#L61
---
# `AuthMachineOptions`
## Parameters
---
**<span className="parameter-name">clientUrl</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">backendUrl</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">devTools</span>** <span className="optional-status">optional</span> <code>boolean</code>
Activate devTools e.g. the ability to connect to the xstate inspector
---
**<span className="parameter-name">autoSignIn</span>** <span className="optional-status">optional</span> <code>boolean</code>
When set to true, will parse the url on startup to check if it contains a refresh token to start the session with
---
**<span className="parameter-name">autoRefreshToken</span>** <span className="optional-status">optional</span> <code>boolean</code>
When set to true, will automatically refresh token before it expires
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/docgen/javascript/auth/types/client-storage)
Object where the refresh token will be persisted and read locally.
Recommended values:
- `'web'` and `'cookies'`: no value is required
- `'react-native'`: `import Storage from @react-native-async-storage/async-storage`
- `'cookies'`: `localStorage`
- `'custom'`: an object that defines the following methods:
- `setItem` or `setItemAsync`
- `getItem` or `getItemAsync`
- `removeItem`
- `'capacitor'`: `import { Storage } from @capacitor/storage`
- `'expo-secure-store'`: `import * as SecureStore from 'expo-secure-store'`
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null &#124; string) =&gt; void &#124; Promise&lt;void&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) =&gt; null &#124; string &#124; Promise&lt;null &#124; string&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) =&gt; void</code> | | |
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">optional</span> [`ClientStorageType`](/reference/docgen/javascript/auth/types/client-storage-type)
Define a way to get information about the refresh token and its exipration date.
**`@default`**
`web`
---
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> <code>number</code>
Time interval until token refreshes, in seconds
---

View File

@@ -1,10 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileItemRef
sidebar_label: FileItemRef
title: AuthMachine
sidebar_label: AuthMachine
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-storage-js/src/machines/multiple-files-upload.ts#L7
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/authentication/machine.ts#L66
---
# `FileItemRef`
# `AuthMachine`

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