Compare commits

...

39 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
Pierre-Louis Mercereau
195adfb04a chore: remove generated documentation from the repository 2022-12-12 21:26:21 +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
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
606 changed files with 5322 additions and 14435 deletions

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,21 @@
# @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

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "0.7.8",
"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,7 +5,7 @@ import Image from 'next/image';
export default function OverviewProjectInfo() {
const { currentApplication } = useCurrentWorkspaceAndApplication();
const { region, subdomain } = currentApplication;
const { region, subdomain } = currentApplication || {};
const isRegionAvailable =
region?.awsName && region?.countryCode && region?.city;

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,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`

View File

@@ -0,0 +1,80 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AuthOptions
sidebar_label: AuthOptions
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/types/client.ts#L121
---
# `AuthOptions`
## Parameters
---
**<span className="parameter-name">refreshIntervalTime</span>** <span className="optional-status">optional</span> <code>number</code>
Time interval until token refreshes, in seconds
---
**<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">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">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">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">devTools</span>** <span className="optional-status">optional</span> <code>boolean</code>
Activate devTools e.g. the ability to connect to the xstate inspector
---

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailContext
sidebar_label: ChangeEmailContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-email.ts#L9
---
# `ChangeEmailContext`
```ts
type ChangeEmailContext = () => { error: [ErrorPayload](/reference/docgen/javascript/auth/types/error-payload) | null }
```

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailEvents
sidebar_label: ChangeEmailEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-email.ts#L13
---
# `ChangeEmailEvents`
```ts
type ChangeEmailEvents =
| { type: 'REQUEST'; email: string; options: ChangeEmailOptions }
| { type: 'SUCCESS' }
| { type: 'ERROR'; error: ErrorPayload | null }
```

View File

@@ -1,19 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailHookResult
sidebar_label: ChangeEmailHookResult
title: ChangeEmailHandlerResult
sidebar_label: ChangeEmailHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useChangeEmail.ts#L20
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changeEmail.ts#L7
---
# `ChangeEmailHookResult`
# `ChangeEmailHandlerResult`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
@@ -25,30 +25,16 @@ use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <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> `boolean`
**`@returns`**
`true` when the action is executing, `false` when it finished its execution.
---
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
---
**<span className="parameter-name">changeEmail</span>** <span className="optional-status">required</span> `ChangeEmailHandler`
Requests the email change. Returns a promise with the current context
---

View File

@@ -1,10 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: FileItemRef
sidebar_label: FileItemRef
title: ChangeEmailMachine
sidebar_label: ChangeEmailMachine
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/change-email.ts#L26
---
# `FileItemRef`
# `ChangeEmailMachine`

View File

@@ -0,0 +1,21 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailOptions
sidebar_label: ChangeEmailOptions
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/types/options.ts#L43
---
# `ChangeEmailOptions`
## Parameters
---
**<span className="parameter-name">redirectTo</span>** <span className="optional-status">optional</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

@@ -1,22 +0,0 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailParams
sidebar_label: ChangeEmailParams
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/utils/types.ts#L99
---
# `ChangeEmailParams`
## Parameters
---
**<span className="parameter-name">newEmail</span>** <span className="optional-status">required</span> `string`
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> `RedirectOption`
---

View File

@@ -0,0 +1,20 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailResponse
sidebar_label: ChangeEmailResponse
description: payload from hasura-auth endpoint /user/email/change
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/types/hasura-auth/responses.ts#L41
---
# `ChangeEmailResponse`
payload from hasura-auth endpoint /user/email/change
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
---

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailServices
sidebar_label: ChangeEmailServices
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-email.ts#L22
---
# `ChangeEmailServices`
```ts
type ChangeEmailServices = () => { request: { data: [ChangeEmailResponse](/reference/docgen/javascript/auth/types/change-email-response) } }
```

View File

@@ -1,19 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangeEmailHookResult
sidebar_label: ChangeEmailHookResult
title: ChangeEmailState
sidebar_label: ChangeEmailState
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useChangeEmail.ts#L20
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changeEmail.ts#L9
---
# `ChangeEmailHookResult`
# `ChangeEmailState`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
@@ -25,13 +25,13 @@ use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <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> `boolean`
**<span className="parameter-name">isLoading</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
@@ -39,16 +39,10 @@ Provides details about the error
---
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> `boolean`
**<span className="parameter-name">needsEmailVerification</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
`true` if an email is required to complete the action, and that a verification email has been sent to complete the action.
---
**<span className="parameter-name">changeEmail</span>** <span className="optional-status">required</span> `ChangeEmailHandler`
Requests the email change. Returns a promise with the current context
---

View File

@@ -0,0 +1,14 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangePasswordContext
sidebar_label: ChangePasswordContext
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-password.ts#L9
---
# `ChangePasswordContext`
```ts
type ChangePasswordContext = () => { error: [ErrorPayload](/reference/docgen/javascript/auth/types/error-payload) | null }
```

View File

@@ -0,0 +1,17 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangePasswordEvents
sidebar_label: ChangePasswordEvents
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-password.ts#L12
---
# `ChangePasswordEvents`
```ts
type ChangePasswordEvents =
| { type: 'REQUEST'; password: string; ticket: string }
| { type: 'SUCCESS' }
| { type: 'ERROR'; error: ErrorPayload | null }
```

View File

@@ -1,19 +1,19 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: AddSecuritKeyHookResult
sidebar_label: AddSecuritKeyHookResult
title: ChangePasswordHandlerResult
sidebar_label: ChangePasswordHandlerResult
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/react/src/useAddSecurityKey.ts#L20
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/promises/changePassword.ts#L9
---
# `AddSecuritKeyHookResult`
# `ChangePasswordHandlerResult`
## Parameters
---
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> `boolean`
**<span className="parameter-name">isError</span>** <span className="optional-status">required</span> <code>boolean</code>
**`@returns`**
@@ -25,20 +25,14 @@ use `!isSuccess` or `!!error` instead
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> `null` | `ErrorPayload`
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <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> `boolean`
**<span className="parameter-name">isSuccess</span>** <span className="optional-status">required</span> <code>boolean</code>
Returns `true` if the action is successful.
---
**<span className="parameter-name">add</span>** <span className="optional-status">required</span> `AddSecurityKeyHandler`
Add a security key to the current user with the WebAuthn API
---

View File

@@ -0,0 +1,10 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangePasswordMachine
sidebar_label: ChangePasswordMachine
description: No description provided.
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/machines/change-password.ts#L25
---
# `ChangePasswordMachine`

View File

@@ -0,0 +1,20 @@
---
# ⚠️ AUTO-GENERATED CONTENT. DO NOT EDIT THIS FILE DIRECTLY! ⚠️
title: ChangePasswordResponse
sidebar_label: ChangePasswordResponse
description: payload from hasura-auth endpoint /user/password
displayed_sidebar: referenceSidebar
custom_edit_url: https://github.com/nhost/nhost/edit/main/packages/hasura-auth-js/src/types/hasura-auth/responses.ts#L35
---
# `ChangePasswordResponse`
payload from hasura-auth endpoint /user/password
## Parameters
---
**<span className="parameter-name">error</span>** <span className="optional-status">required</span> <code>null &#124; [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
---

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