Compare commits
39 Commits
@nhost/rea
...
@nhost/rea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc1730fce | ||
|
|
c1cd1e813c | ||
|
|
e08a074474 | ||
|
|
95932fa3f2 | ||
|
|
99402b77d1 | ||
|
|
f6fb2cd8e6 | ||
|
|
5c2cf59b41 | ||
|
|
a6d31dc260 | ||
|
|
bd73557a47 | ||
|
|
c95bab70c2 | ||
|
|
195adfb04a | ||
|
|
d8c2d369aa | ||
|
|
a4e4926aeb | ||
|
|
2764a1c4b6 | ||
|
|
a0901914ac | ||
|
|
26d577d7ae | ||
|
|
622c48a94b | ||
|
|
e1a87a05b1 | ||
|
|
2148317282 | ||
|
|
5f9c6c8346 | ||
|
|
57db5b83d4 | ||
|
|
3cab18713a | ||
|
|
fb94dae43a | ||
|
|
f694846eae | ||
|
|
322ab50138 | ||
|
|
435efd2bc5 | ||
|
|
5501a5937e | ||
|
|
80a6808a82 | ||
|
|
987bd70312 | ||
|
|
feb22e62c1 | ||
|
|
e7d4c77a6d | ||
|
|
628e32464d | ||
|
|
dc82043254 | ||
|
|
997e9d58a8 | ||
|
|
8a3f1706fe | ||
|
|
12cbe4d534 | ||
|
|
9f21931201 | ||
|
|
09351e1910 | ||
|
|
1c2ea5a407 |
@@ -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'],
|
||||
|
||||
@@ -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'"
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:*",
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
1
docs/.gitignore
vendored
@@ -19,3 +19,4 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.vercel
|
||||
docs/reference/docgen
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"label": "Auth"
|
||||
}
|
||||
@@ -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<EnableMfaContext, any, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | ErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta<Typegen0, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | ErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, ServiceMap>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">code</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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) => void</code>
|
||||
|
||||
---
|
||||
@@ -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<NhostClientOptions, "clientStorageGetter" | "clientStorageSetter" | "clientStorageType" | "clientStorage"></code>
|
||||
|
||||
---
|
||||
@@ -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<ChangeEmailContext, any, { type: "REQUEST", email: string, options: ChangeEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: ChangeEmailContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: ChangeEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, ChangeEmailServices>></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'`. |
|
||||
|
||||
---
|
||||
@@ -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<ChangePasswordContext, any, { type: "REQUEST", password: string, ticket: string } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: ChangePasswordContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", password: string, ticket: string } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, ChangePasswordServices>></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>
|
||||
|
||||
---
|
||||
@@ -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 |
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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<string, unknown></code>
|
||||
|
||||
---
|
||||
@@ -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<EnableMfaContext, any, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | ErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: EnableMfaContext }, ResolveTypegenMeta<Typegen0, { type: "GENERATE" } | { type: "ACTIVATE", code: string, activeMfaType: "totp" } | { type: "GENERATED" } | { type: "GENERATED_ERROR", error: null | ErrorPayload } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, ServiceMap>></code>
|
||||
|
||||
---
|
||||
@@ -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 | string</code> | ✔️ | Access token (JWT) |
|
||||
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>user</span> | <code>null | [`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 | [`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> | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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<Record<StateErrorTypes, ErrorPayload>></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 | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>{ startedAt: Date | null, attempts: number, lastAttempt: Date | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>{ value: string | null, expiresAt: Date | null }</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>{ ticket: string } | null</code> | ✔️ | |
|
||||
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/docgen/javascript/auth/types/user) | null</code> | ✔️ | |
|
||||
|
||||
---
|
||||
@@ -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
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
@@ -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 })
|
||||
```
|
||||
@@ -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` | | |
|
||||
|
||||
---
|
||||
@@ -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` | | |
|
||||
|
||||
---
|
||||
@@ -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` | | |
|
||||
|
||||
---
|
||||
@@ -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` | | |
|
||||
|
||||
---
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
@@ -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
|
||||
|
||||
---
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
@@ -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)
|
||||
|
||||
---
|
||||
@@ -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')
|
||||
}
|
||||
```
|
||||
@@ -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')
|
||||
}
|
||||
```
|
||||
@@ -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')
|
||||
}
|
||||
```
|
||||
@@ -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()
|
||||
```
|
||||
@@ -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()
|
||||
```
|
||||
@@ -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()
|
||||
```
|
||||
@@ -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-`.
|
||||
|
||||
---
|
||||
@@ -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`
|
||||
|
||||
---
|
||||
@@ -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()
|
||||
```
|
||||
@@ -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()
|
||||
```
|
||||
@@ -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 |
|
||||
|
||||
---
|
||||
@@ -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()`
|
||||
@@ -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 | string</code>
|
||||
|
||||
---
|
||||
@@ -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 | string</code>
|
||||
|
||||
---
|
||||
@@ -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 | string</code>
|
||||
|
||||
---
|
||||
@@ -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 | string</code>
|
||||
|
||||
---
|
||||
@@ -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 | string) => void | Promise<void></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => void</code> | | |
|
||||
|
||||
---
|
||||
@@ -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) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null | string) => void | Promise<void></code> | | |
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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<ResetPasswordContext, any, { type: "REQUEST", email: string, options: ResetPasswordOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: ResetPasswordContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: ResetPasswordOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, ResetPasswordServices>></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'`. |
|
||||
|
||||
---
|
||||
@@ -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>
|
||||
|
||||
---
|
||||
@@ -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<SendVerificationEmailContext, any, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, { value: any, context: SendVerificationEmailContext }, ResolveTypegenMeta<Typegen0, { type: "REQUEST", email: string, options: SendVerificationEmailOptions } | { type: "SUCCESS" } | { type: "ERROR", error: null | ErrorPayload }, BaseActionObject, SendVerificationEmailServices>></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'`. |
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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<string, unknown></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<string></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 |
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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<string></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<string, unknown></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'`. |
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></code>
|
||||
|
||||
---
|
||||
|
||||
**<span className="parameter-name">all</span>** <span className="optional-status">optional</span> <code>boolean</code>
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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<string, unknown></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<string></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 |
|
||||
|
||||
---
|
||||
@@ -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<AuthContext, any, { 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" }, { value: any, context: AuthContext }, ResolveTypegenMeta<Typegen0, { 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" }, BaseActionObject, AuthServices>></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<string, unknown></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<string></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 |
|
||||
|
||||
---
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"label": "Types",
|
||||
"position": 1,
|
||||
"className": "hidden",
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"slug": "/reference/docgen/javascript/auth/types"
|
||||
}
|
||||
}
|
||||
@@ -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 | [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
@@ -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.
|
||||
|
||||
---
|
||||
@@ -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.
|
||||
|
||||
---
|
||||
@@ -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 | [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
@@ -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 | [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
|
||||
|
||||
Provides details about the error
|
||||
|
||||
---
|
||||
@@ -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 | [`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.
|
||||
|
||||
---
|
||||
@@ -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 | [`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.
|
||||
|
||||
---
|
||||
@@ -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'
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
@@ -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 }
|
||||
```
|
||||
@@ -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' }
|
||||
```
|
||||
@@ -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`
|
||||
@@ -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 | string) => void | Promise<void></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => 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
|
||||
|
||||
---
|
||||
@@ -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`
|
||||
@@ -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 | string) => void | Promise<void></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) => null | string | Promise<null | string></code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: { key: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: { key: string }) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: { key: string, value: string }) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) => void</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) => any</code> | | |
|
||||
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) => 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
|
||||
|
||||
---
|
||||
@@ -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 }
|
||||
```
|
||||
@@ -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 }
|
||||
```
|
||||
@@ -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 | [`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
|
||||
|
||||
---
|
||||
@@ -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`
|
||||
@@ -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'`.
|
||||
|
||||
---
|
||||
@@ -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`
|
||||
|
||||
---
|
||||
@@ -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 | [`ErrorPayload`](/reference/docgen/javascript/auth/types/error-payload)</code>
|
||||
|
||||
---
|
||||
@@ -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) } }
|
||||
```
|
||||
@@ -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 | [`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
|
||||
|
||||
---
|
||||
@@ -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 }
|
||||
```
|
||||
@@ -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 }
|
||||
```
|
||||
@@ -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 | [`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
|
||||
|
||||
---
|
||||
@@ -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`
|
||||
@@ -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 | [`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
Reference in New Issue
Block a user