- cb63233: chore: add react 19 as peer dependency
- @nhost/nhost-js@3.2.4
- 04d2ce1: feat: add signin security key with user handle
- @nhost/nhost-js@3.2.3
- @nhost/nhost-js@3.2.2
- 14e6100: feat: add support for ID token sign-in from authentication providers
- @nhost/nhost-js@3.2.1
- fe6e8e2: feat: add email OTP sign-in functionality
- Updated dependencies [72899a6]
- @nhost/nhost-js@3.2.0
- 55d8bb5: feat: add
requestOptions
tosignUpEmailPassword
to allow passing extra headers with the signup request
- @nhost/nhost-js@3.1.10
- @nhost/nhost-js@3.1.9
- @nhost/nhost-js@3.1.8
- @nhost/nhost-js@3.1.7
- @nhost/nhost-js@3.1.6
- @nhost/nhost-js@3.1.5
- @nhost/nhost-js@3.1.4
- d0c9f4c: fix: replace
jose
withjwt-decode
version 4.0.0
- @nhost/nhost-js@3.1.3
- Updated dependencies [4c35171]
- Updated dependencies [3cea460]
- @nhost/nhost-js@3.1.2
- @nhost/nhost-js@3.1.1
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
- @nhost/nhost-js@3.0.11
- 768ca17: chore: update dependencies
- @nhost/nhost-js@3.0.10
- 311374e: feat: add
connect
param touseProviderLink
hook- @nhost/nhost-js@3.0.10
- @nhost/nhost-js@3.0.9
- 49a80c2: chore: update dependencies
- @nhost/nhost-js@3.0.8
- @nhost/nhost-js@3.0.8
- @nhost/nhost-js@3.0.7
- @nhost/nhost-js@3.0.6
- 017f1a6: feat: add elevated permission examples
- @nhost/nhost-js@3.0.5
- @nhost/nhost-js@3.0.4
- 1a61c65: feat: add 'elevateEmailSecurityKey' to the SDKs along with integration into react-apollo and vue-apollo examples
- e5bab6a: chore: update dependencies
- @nhost/nhost-js@3.0.3
- 8d91f71: chore: update deps and enable pnpm audit
- Updated dependencies [8d91f71]
- @nhost/nhost-js@3.0.2
- @nhost/nhost-js@3.0.1
- bc9eff6e4: chore: remove support for using backendUrl when instantiating the Nhost client
- Updated dependencies [bc9eff6e4]
- @nhost/nhost-js@3.0.0
- Updated dependencies [8b127fbb6]
- @nhost/nhost-js@2.2.18
- 66c3193bc: Update useChangePassword hook interface to include ActionLoadingState
- 00c363f80: fix(docs): update changeEmail usage reference
- 4fe4a1696: return
refreshToken
immediately after signIn and signUp- @nhost/nhost-js@2.2.17
- @nhost/nhost-js@2.2.16
- @nhost/nhost-js@2.2.15
- @nhost/nhost-js@2.2.14
- @nhost/nhost-js@2.2.13
- @nhost/nhost-js@2.2.12
- @nhost/nhost-js@2.2.11
- b3b64a3b7: chore(deps): bump
@types/react
tov18.2.14
and@types/react-dom
tov18.2.6
- Updated dependencies [07a45fde0]
- @nhost/nhost-js@2.2.10
- Updated dependencies [5a4e237a2]
- @nhost/nhost-js@2.2.9
- @nhost/nhost-js@2.2.8
- @nhost/nhost-js@2.2.7
- Updated dependencies [aa3c62989]
- @nhost/nhost-js@2.2.6
- 203bc97f: feat(pat): add support for personal access tokens
- 7fea29a8: fix: update
types
config and fix the exposed React components - Updated dependencies [7fea29a8]
- @nhost/nhost-js@2.2.5
- @nhost/nhost-js@2.2.4
- da03bf39: chore(build): change build target to ES2019
- Updated dependencies [da03bf39]
- @nhost/nhost-js@2.2.3
- 90c60311: chore(deps): add
types
topackage.json
- Updated dependencies [90c60311]
- @nhost/nhost-js@2.2.2
- Updated dependencies [08e70b9d]
- @nhost/nhost-js@2.2.1
- 43b1b144: chore(deps): bump
@types/react
to v18.0.34 and@types/react-dom
to v18.0.11- @nhost/nhost-js@2.2.0
- Updated dependencies [a0e093d7]
- @nhost/nhost-js@2.2.0
- @nhost/nhost-js@2.1.2
- @nhost/nhost-js@2.1.1
- Updated dependencies [bfb4c1a6]
- @nhost/nhost-js@2.1.0
- f375eacc: fix(react): accept service URLs
- Updated dependencies [088584e7]
- @nhost/nhost-js@2.0.9
- Updated dependencies [1d155559]
- @nhost/nhost-js@2.0.8
- 850a049c: chore(deps): update docker/build-push-action action to v4
- Updated dependencies [850a049c]
- @nhost/nhost-js@2.0.7
- 4bf40995: chore(deps): bump
typescript
to4.9.5
- 8bb097c9: chore(deps): bump
vitest
- Updated dependencies [4bf40995]
- Updated dependencies [8bb097c9]
- Updated dependencies [35d52aab]
- @nhost/nhost-js@2.0.6
- Updated dependencies [3c7cf92e]
- @nhost/nhost-js@2.0.5
- 01318860: fix(nhost-js): use correct URL for functions requests
- Updated dependencies [01318860]
- @nhost/nhost-js@2.0.4
- 445d8ef4: chore(deps): bump
@nhost/nhost-js
version to 2.0.3 - Updated dependencies [445d8ef4]
- @nhost/nhost-js@2.0.3
- Updated dependencies [2d9145f9]
- @nhost/nhost-js@2.0.2
- @nhost/nhost-js@2.0.1
-
19b11d40: Remove deprecated signatures in React hooks
It is now not possible to send the input values of the following hooks when creating them:
useChangeEmail
useChangePassword
useResetPassword
useSendVerificationEmail
useSignInEmailPassword
useSignInEmailPasswordless
useSignUpEmailPassword
For instance, it is not possible to do the following:
const [email, setEmail] = useState('') const { changeEmail } = useChangeEmail(email) const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => { e.preventDefault() await changeEmail() } return <form onSubmit={ handleSubmit }> <input value={email} onChange={onChange={(event) => setEmail(event.target.value)}} /> </form>
Instead, write:
const [email, setEmail] = useState('') const { changeEmail } = useChangeEmail() const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => { e.preventDefault() await changeEmail(email) } return <form onSubmit={ handleSubmit }> <input value={email} onChange={onChange={(event) => setEmail(event.target.value)}} /> </form>
-
19b11d40: Remove deprecated hooks
useNhostAuth
: useuseNhostClient
insteaduseAuthLoading
: useuseAuthenticationStatus
insteaduseAvatarUrl
: useuseUserAvatarUrl
instead.useDefaultRole
: useuseUserDefaultRole
instead.useDisplayName
: useuseUserDisplayName
instead.useEmail
: useuseUserEmail
instead.useIsAnonymous
: useuseUserIsAnonymous
instead.useNhostBackendUrl
: useuseNhostClient
instead, then the urls in the respectivenhost.<auth,storage,graphql,functions>
clients
- Updated dependencies [c9d2d31a]
- Updated dependencies [80bbd3a1]
- Updated dependencies [80bbd3a1]
- Updated dependencies [2949ff0f]
- @nhost/nhost-js@2.0.0
- 5013213b: chore(deps): update dependency @nhost/docgen to 0.1.6
- bf1e4071: chore(react): fix exports for
@nhost/nextjs
- Updated dependencies [5013213b]
- @nhost/nhost-js@1.13.4
- @nhost/nhost-js@1.13.3
- @nhost/nhost-js@1.13.2
- 200e9f77: chore(deps): update dependency @types/react-dom to v18.0.10
- Updated dependencies [200e9f77]
- @nhost/nhost-js@1.13.1
-
c2706c7d: Export commonly used types
BackendUrl
,ErrorPayload
,NhostSession
,Subdomain
, andUser
are now exported in all our SDKs -
d42c27ae: Add explicit return types to React hooks
- @nhost/nhost-js@1.13.0
- 1be6d324: Only export what is required by the user or
@nhost/nextjs
- 2e8f73df: Improve the error message when the application is not wrapped in
<NhostProvider></NhostProvider>
- 85683547: Allow
useFileUpload
to be reused Once a file were uploaded withuseFileUpload
, it was not possible to reuse it as the returned file id were kept in memory and sent again to hasura-storage, leading to a conflict error. File upload now makes sure to clear the metadata information from the first file before uploading the second file.- @nhost/nhost-js@1.12.1
-
65687bee: Remove
@nhost/nhost-js
frompeerDepencencies
The contents of the
@nhost/nhost-js
package are now exported by@nhost/react
.
- b21222b3: chore(deps): update dependency @types/node to v16
- 54df0df4: Remove unused immer dependency
- 54df0df4: Improve the initialisation of the internal authentication state to support React 18 strict mode
- Updated dependencies [b21222b3]
- Updated dependencies [19cca7f4]
- Updated dependencies [65687bee]
- Updated dependencies [54df0df4]
- Updated dependencies [1a9e1fde]
- Updated dependencies [5be9abb0]
- Updated dependencies [54df0df4]
- @nhost/nhost-js@1.12.0
- 57db5b83: Refactor: remove dependency to
@nhost/core
- Updated dependencies [57db5b83]
- @nhost/hasura-auth-js@1.7.0
- @nhost/hasura-storage-js@0.8.0
- @nhost/nhost-js@1.7.0
-
7f251111: Use
NhostProvider
instead ofNhostReactProvider
andNhostNextProvider
NhostReactProvider
andNhostNextProvider
are now deprecated
- 132a4f4b: chore(deps): synchronize @types/react-dom and @types/react versions
- 2e6923dc: Refactoring: use xstate's
interpreter.getSnapshot()
instead ofinterpreter.state
- Updated dependencies [66b4f3d0]
- Updated dependencies [2e6923dc]
- Updated dependencies [ef117c28]
- Updated dependencies [aebb8225]
- @nhost/core@0.9.4
- @nhost/hasura-storage-js@0.7.4
- @nhost/nhost-js@1.6.2
- 4601d84e: Adding
<SignedIn />
and<SignedOut />
components.
- 843087cb: Make
useUserRoles
reactive
- Updated dependencies [f2aaff05]
- @nhost/core@0.9.3
- @nhost/hasura-storage-js@0.7.3
- @nhost/nhost-js@1.6.1
- Updated dependencies [996e8016]
- Updated dependencies [996e8016]
- Updated dependencies [869e7253]
- Updated dependencies [996e8016]
- Updated dependencies [b5395be2]
- @nhost/core@0.9.2
- @nhost/hasura-storage-js@0.7.2
- @nhost/nhost-js@1.6.0
- Updated dependencies [6b9d163e]
- @nhost/core@0.9.1
- @nhost/hasura-storage-js@0.7.1
- @nhost/nhost-js@1.5.2
- 6da44bf8: The
useAuthenticationStatus
hook now returns the number of attempts to get an access token from the serverconnectionAttempts
.
- ba785da1: Bump dependencies versions
- Updated dependencies [13c41fe6] [ba785da1] [3ced63ab]
- @nhost/core@0.9.0
- @nhost/hasura-storage-js@1.0.0
- @nhost/nhost-js@1.5.1
-
739a3c45: Sign up with an email and a security key.
Use the hook
useSignUpEmailSecurityKey
to sign up a user with security key and an email using the WebAuthn API.const { signUpEmailSecurityKey, needsEmailVerification, isLoading, isSuccess, isError, error } = useSignUpEmailSecurityKey() console.log({ needsEmailVerification, isLoading, isSuccess, isError, error }) const handleFormSubmit = async (e) => { e.preventDefault() await signUpEmailSecurityKey('joe@example.com') }
- Updated dependencies [739a3c45]
- Updated dependencies [8e4d790b]
- @nhost/nhost-js@1.5.0
- @nhost/core@0.8.0
- @nhost/hasura-storage-js@1.0.0
- Updated dependencies [9eb78e06]
- @nhost/core@0.7.7
- @nhost/hasura-storage-js@0.6.1
- @nhost/nhost-js@1.4.12
- @nhost/nhost-js@1.4.11
- Updated dependencies [607c457f]
- @nhost/hasura-storage-js@0.6.0
- @nhost/nhost-js@1.4.10
- Updated dependencies [eb46f7d8]
- @nhost/nhost-js@1.4.9
- @nhost/nhost-js@1.4.8
-
84ba29dd: Introduce
useSignInSmsPasswordless
const { signInSmsPasswordless, sendOtp, needsOtp, isLoading, isSuccess, isError, error } = useSignInSmsPasswordless()
- The
signInSmsPasswordless
action will send a one-time password to the given phone number. - The client is then awaiting the OTP.
needsOtp
equals true - After the code is received by SMS, the client sends the code with
sendOtp
. On success, the client is authenticated, andisSuccess
equalstrue
.
Any error is monitored through
isError
anderror
. While thesignInSmsPasswordless
andsendOtp
actions are running,isLoading
equalstrue
- The
- 10beea72: Fix React Native build: Export
package.json
for all npm packages. - Updated dependencies [747aa969]
- Updated dependencies [10beea72]
- @nhost/core@0.7.6
- @nhost/hasura-storage-js@0.5.3
- @nhost/nhost-js@1.4.7
- Updated dependencies [197d1d5c]
- @nhost/core@0.7.5
- @nhost/hasura-storage-js@0.5.2
- @nhost/nhost-js@1.4.6
- Updated dependencies [6eaa5c79]
- @nhost/core@0.7.4
- @nhost/hasura-storage-js@0.5.1
- @nhost/nhost-js@1.4.5
-
4f928756: Extend file upload parameters
bucketId
is available everywhere as an option- It is possible to pass files as a parameter on a multiple
upload
, making theadd
action optional. - The
add
andupload
actions of multiple file upload accepts both aFile
, an array ofFile
items, and aFileList
- Updated dependencies [4f928756]
- @nhost/hasura-storage-js@0.5.0
- @nhost/nhost-js@1.4.4
- f9854b15: Upload multiple files with
useMultipleFilesUpload
- f9854b15:
useFileUpload
: keep track of upload progress and cancel upload
- Updated dependencies [f9854b15]
- Updated dependencies [f9854b15]
- @nhost/hasura-storage-js@0.4.0
- @nhost/core@0.7.3
- @nhost/nhost-js@1.4.3
- dbc10e62: fixed
exports
field to support imports in a server-side environment - Updated dependencies [dbc10e62]
- @nhost/core@0.7.2
- @nhost/nhost-js@1.4.2
- Updated dependencies [b8f4b75b]
- @nhost/nhost-js@1.4.1
- 6f0a3005:
sendMfaOtp
now returns a promise When usinguseSignInEmailPassword
, thesendMfaOtp
wasvoid
. It now returns a promise that resolves when the server returned the result of the OTP code submission, and returnsisSuccess
,isError
, anderror
.
- Updated dependencies [6f0a3005]
- Updated dependencies [6f0a3005]
- @nhost/nhost-js@1.4.0
- @nhost/core@0.7.1
- c1613394: Deanonymisation
Once signed in anonymously, users can deanonymise using
nhost.auth.deanonymize
. Deanonymisation works the same way as email+password sign-up or passwordless sign-in. The related methods, hooks in React and composables in Vue can therefore be used for deanonymising users, such asnhost.auth.signUp
,useSignUpEmailPassword
, anduseSignInEmailPasswordless
.
- Updated dependencies [c1613394]
- @nhost/core@0.7.0
- @nhost/nhost-js@1.3.0
- 08a37aae: correct rewriting options when
clientUrl
is not available The client URL is set towindow.location.origin
, so it can rewrite redirection urls that are passed on to authenticaion methods. However,clientUrl
is set to''
when running on the server side. This fix then avoid raising an error when trying to rewriteredirectTo
on non-browser environment, and forcesuseProviderLink
to be rendered on the client side. - Updated dependencies [08a37aae]
- @nhost/core@0.6.5
- @nhost/nhost-js@1.2.4
- ebad0936: reverted ESM related changes
- Updated dependencies [ebad0936]
- @nhost/core@0.6.4
- @nhost/nhost-js@1.2.3
- 1b37b9f6: fix: ESM import path fixes
- Updated dependencies [1b37b9f6]
- @nhost/core@0.6.3
- @nhost/nhost-js@1.2.2
- 78341491: fix: Next.js and React issues with ESM packages chore: Updated output bundle names
- Updated dependencies [78341491]
- @nhost/core@0.6.2
- @nhost/nhost-js@1.2.1
- bc11c9e5: chore: Changed copy script to support Windows fix: Fixed warnings about unknown globals occurring while building the packages
- 2b2f8e91: fix: ESM related issues in Node environments
chore: Improved the way different formats are exposed via
exports
field in package.js - Updated dependencies [bc11c9e5]
- Updated dependencies [2b2f8e91]
- Updated dependencies [858014e4]
- @nhost/core@0.6.1
- @nhost/nhost-js@1.2.0
- 7c8f0926: add the
mfa
ticket touseSignInEmailPassword
TheuseSignInEmailPassword
hook was not returning the MFA ticket. This releases fixes the issue. - 7c8f0926: use the same methods and typings to interact with xstate machines in both
@nhost/hasura-auth-js
,@nhost/react
hooks and@nhost/vue
composables Both@nhost/react
,@nhost/hasura-auth-js
and@nhost/vue
interact with the authentication state in a similar way. As a result, the same code was repeated three times, with risks of insonsistency and difficult maintainability.@nhost/core
now contains the logic and Typescript interfaces that are used in the Vanilla client, React hooks and Vue composables. - Updated dependencies [7c8f0926]
- Updated dependencies [7c8f0926]
- Updated dependencies [7c8f0926]
- @nhost/core@0.6.0
- @nhost/nhost-js@1.1.14
- Updated dependencies [6c423394]
- @nhost/core@0.5.6
- @nhost/nhost-js@1.1.13
- Updated dependencies [0b58894e]
- Updated dependencies [c7a407f1]
- @nhost/core@0.5.5
- @nhost/nhost-js@1.1.12
- 9d32314: Return an error when trying sign to in/up/out from hooks while in the wrong authentication status The actions of the authentication hooks were not resolving the promise when executed from the wrong authentication status. They now return an error.
- 236ce72: Correct
useSignUpEmailPassword
loading state - 236ce72: Correct email verification states
email verification returns
false
when the client has started and it is still undetermined - Updated dependencies [9d32314]
- Updated dependencies [e094e68]
- Updated dependencies [236ce72]
- @nhost/core@0.5.4
- @nhost/nhost-js@1.1.11
- 2887ce0: @xstate/react bump to support React 18
- 584976d: - publishable directory structure changes (ESM, CJS and UMD included in the output)
- build system improvements
- fixed some bundling concerns (#428)
- Updated dependencies [584976d]
- @nhost/core@0.5.3
- @nhost/nhost-js@1.1.10
- @nhost/nhost-js@1.1.9
- 58fa2a2: Improve loading status
The
loading
status indicates the authentication is not yet known to the client when it starts. Once the client is ready, the authentication status is either signed in, or signed out. When the user was trying to authenticate, theloading
status was set totrue
until the result of the authentication was known. The client now only returnloading: true
on startup, and in no other cases. - 58fa2a2: Look for a valid refresh token both the URL and local storage
When auto-signin was activated, the client was not taking into account the refresh token in the URL if a token was already stored locally.
The user was then not able to authenticate from a link when the refresh token stored locally was invalid or expired.
When auto-signin is activated, the client now checks and tries tokens from both the URL and the local storage, starting with the URL.
- @nhost/nhost-js@1.1.8
- 42edb74: Adapt to React 18
-
b56162a: prefer clientStorage/clientStorageType to clientStorageGetter/clientStorageSetter
-
1fb51a7: Rename user data hooks to make them all start with
userUser...
The hooks that help to access user data were not consistently named. The following hooks have been therefore renamed:useAvatarUrl
->useUserAvatarUrl
useDefaultRole
->useUserDefaultRole
useDisplayName
->useUserDisplayName
useEmail
->useUserEmail
useIsAnonymous
->useUserIsAnonymous
Their former names are still available for backwards compatibility, but are flagged as deprecated.
-
54e1873: Fix: add authentication headers to GraphQL operations when authenticated
-
Updated dependencies [185f39e]
- @nhost/nhost-js@1.1.7
- @nhost/nhost-js@1.1.6
- 616e320: Remove
refreshToken
from the url whenautoSignIn
is set On startup, when theautoSignIn
option is set totrue
, the client now removes it from the URL when the page loads. - 1ce55c5: Add new hooks:
useDecodedAccessToken()
,useHasuraClaims()
, anduseHasuraClaim(name: string)
- 616e320: Look for the refresh token both in the query parameters and in the hash Until now, after redirecting from an email, Hasura-auth puts refresh tokens in the hash part of the url. It is a problem when using SSR as the hash is not accessible to the server. This behaviour is likely to change. As a result, the client now parses both the hash and the query parameters of the url. See this issue to keep track of the progress on Hasura-auth.
- 49545c0: Remove filtering of
useLayoutEffect
from logs ThesuppressConsoleMessage
method was meant to suppress incorrectuseLayoutEffect
messages raised on Nextjs server-side renderings. Its implementation had an impact on the normal functionning of logging (see #447). This filtering was necessary when using former versions of xstate and can now be removed. - b52b4fc: Bump xstate to latest version (
4.31.0
) - Updated dependencies [d49b837]
- @nhost/nhost-js@1.1.5
- @nhost/nhost-js@1.1.4
- 5ee395e: Ensure the session is destroyed when signout is done
In the
useSignOut
hook,signOut
now returns a promise. We are now sure the user session is empty once the promise is resolved.- @nhost/nhost-js@1.1.3
- @nhost/nhost-js@1.1.2
- @nhost/nhost-js@1.1.1
- Updated dependencies [ccba0b5]
- @nhost/nhost-js@1.1.0
- @nhost/nhost-js@1.0.11
- Updated dependencies [2c97db6]
- @nhost/nhost-js@1.0.10
-
7135aee: Add user and accessToken to authentication hooks
Hooks that can complete a successful authentication now have two additional
user
andaccessToken
exported states:useSignInEmailPassword
useSignInAnonymous
useSignUpEmailPassword
-
587eaff: Return a promise with the current context to hooks actions It is now possible to get the result of an action. Hook handlers return the action context in a promise.
const { signInEmailPasswordless, isError } = useSignInEmailPasswordless() const MyComponent = () => { return <div> <button onClick={async () => { const { isSuccess, isError, error } = await signInEmailPasswordless('johan@ikea.se') if (isError) { console.log(error) }}}/> {isError && <div>an error occurred</div>} <div> }
-
7cf875f: Deprecate the use of values sent as hook parameters
Although handlers parameters of authentication hooks can be given when creating the hook, it is recommended to use them when executing the handler. For instance, instead of:
const { signInEmailPasswordless } = useSignInEmailPasswordless('nuno@fcporto.pt') signInEmailPasswordless()
It is recommended to use the following syntax:
const { signInEmailPasswordless } = useSignInEmailPasswordless() signInEmailPasswordless('nuno@fcporto.pt')
No breaking change has been introduced. For instance,
useSignUpEmailPassword('szilard@brussels.be','1234', options)
will appear as deprecated but will work, whileuseSignUpEmailPassword(options)
will work too.- @nhost/nhost-js@1.0.9
- @nhost/nhost-js@1.0.8
- @nhost/nhost-js@1.0.5
- @nhost/nhost-js@1.0.2
-
39df4d5: Deprecate
useAuthLoading
and introduceuseAuthenticationStatus
When using bothuseAuthLoading
anduseAuthenticated
together, the hooks rerender independently from each other. As a result, when a user loads the page while he previously authenticated, the hooks values were chronologically:isLoading isAuthenticated true
false
false
false
false
true
The intermediate (
false
,false
) is incorrect and is causing issues when using an authentication gate.It is therefore recommended to stop using
useAuthLoading
, and to useuseAuthenticationStatus
instead, in order to keep the loading state and the authentication in sync within the same hook.Usage:
const { isLoading, isAuthenticated } = useAuthenticationStatus()
Fixes this issue
- @nhost/nhost-js@1.0.1
-
744fd69: Introducing
useSendVerificationEmail
While
useSignInEmailPassword
automatically sends a verification email (when the backend is configured to do so), an user may sometime want to request for an verification email to be sent again. See the documentation for further information about how to use this hook. -
744fd69: Rename hooks and their methods to make them more explicit
-
useEmailPasswordlessSignIn
- Hook renamed to
useSignInEmailPasswordless
signIn
renamed tosignInEmailPasswordless
- Hook renamed to
-
useEmailPasswordSignIn
- Hook renamed to
useSignInEmailPassword
signIn
renamed tosignInEmailPassword
needsVerification
renamed toneedsEmailVerification
- Hook renamed to
-
useEmailPasswordSignUp
- Hook renamed to
useSignUpEmailPassword
signUp
renamed tosignUpEmailPassword
needsVerification
renamed toneedsEmailVerification
- Hook renamed to
-
useAnonymousSignIn
- Hook renamed to
useSignInAnonymous
- renamed
signIn
tosignInAnonymous
- Hook renamed to
-
useChangeEmail
needsVerification
renamed toneedsEmailVerification
-
-
744fd69: Introducing
useSignInAnonymous
Anonymous Sign-In is a feature that allows users to get a temporary id without attaching yet any personal information such as an email or a passowrd.
Anonymous users can then run GraphQL operations, with a specific
public
role that is distinct from the defaultuser
role. The anonymous can then "deanonymize" their account at a later stage in attaching the missing registration information and an authentication method.Note Anonymous Sign-In is not available out of the box yet in the Nhost cloud, but will be available in the near future.
Note 2 The deanonymisation process is not yet available. This is also part of our roadmap.
const { signInAnonymous, isLoading, isSuccess, isError, error } = useSignInAnonymous()
Name Type Notes signInAnonymous
() => void Registers an anonymous user isLoading
boolean Returns true
when the action is executing,false
when it finished its execution.isSuccess
boolean Returns true
if the sign-up suceeded. Returnsfalse
if the new email needs to be verified first, or if an error occurred.isError
boolean Returns true
if an error occurred.error
{status: number, error: string, message: string} | undefined Provides details about the error. import { useSignInAnonymous } from '@nhost/react' const Component = () => { const { signInAnonymous, isSuccess } = useSignInAnonymous(email, password) return ( <div> <button onClick={signInAnonymous}>Anonymous sign-in</button> {isSuccess && <div>You are now signed in anonymously</div>} </div> ) }
-
744fd69: Add options to
useProviderLink
Since Hasura Auth version 0.4, it is possible to pass on options when signing up or signin in through an OAuth provider. It is now possible to determine these options in the
useProviderLink
, so it generates the right URL when using the provider links.See the React documentation for additional information.
-
744fd69: Time-based One-Time Password Multi-Factor Authentication
Note MFA is not available out of the box yet in the Nhost cloud, but will be available in the near future.
When enabled in the backend, users that signed up with an email and a password can opt-in for an additional authentication security measure. MFA can be activated in using the new
useConfigMfa
hook.Two methods has been also added to
useEmailPasswordSignIn
: when MFA is active, authentication won't be a success straight after signin up with an email and a password. The newneedsMfaOtp
will then appear astrue
, and the authentication will succeed only when the user will have sent back the OTP code withsendMfaOtp(code:string)
.const { generateQrCode, isGenerating, isGenerated, qrCodeDataUrl, activateMfa, isActivating, isActivated, isError, error } = useConfigMfa(code?: string)
Name Type Notes generateQrCode
() => void Generates the QR code that will be used by the MFA app e.g. Google Authenticator or Authy. isGenerating
boolean Returns true
if the QR code is generating but not yet availableisGenerated
boolean Returns true
when the QR code has been successfully generated and is availableqrCodeDataUrl
string Returns the QR code as a Data URL activateMfa
(code?: string) => void Activate MFA from the code given by the MFA authentication application isActivating
boolean Returns true
when the activation code has been sent to the server, and we await server responseisActivated
boolean Returns true
when MFA has been successfully activatedisError
boolean Returns true
if an error occurred.error
{status: number, error: string, message: string} | undefined Provides details about the error. import { useConfigMfa } from '@nhost/react' import { useState } from 'react' export const Mfa: React.FC = () => { const [code, setCode] = useState('') const { generateQrCode, activateMfa, isActivated, isGenerated, qrCodeDataUrl } = useConfigMfa(code) return ( <div> {!isGenerated && ( <button block appearance="primary" onClick={generateQrCode}> Generate </button> )} {isGenerated && !isActivated && ( <div> <img alt="qrcode" src={qrCodeDataUrl} /> <input value={code} onChange={onChange={(event) => setCode(event.target.value)}} placeholder="Enter activation code" /> <button block appearance="primary" onClick={activateMfa}> Activate </button> </div> )} {isActivated && <div>MFA has been activated!!!</div>} </div> ) }
-
744fd69: Unify vanilla, react and next APIs so they can work together React and NextJS libraries now works together with
@nhost/nhost-js
. It also means the Nhost client needs to be initiated before passing it to the React provider. See the React and NextJS configuration documentation for additional information.
- Updated dependencies [744fd69]
- @nhost/nhost-js@1.0.0
- 0d8afde: Bump xstate version 4.30.5
- Updated dependencies [0d8afde]
- @nhost/client@0.2.1
-
207ae38: New React client
This release brings a full rewrite of the React client, to make it tree shakable and fully reactive. See the documentation for further information.
useAccessToken
useAnonymousSignIn
useAuthenticated
useChangeEmail
useChangePassword
useEmail
useEmailPasswordlessSignIn
useEmailPasswordSignIn
useEmailPasswordSignUp
useIsAnonymous
useAuthLoading
useNhost
useNhostBackendUrl
useNhostInterpreter
useResetPassword
useSignOut
useUserData
useUserLocale
- the
useNhostAuth
has not been included. UseuseAuthenticated
together withuseAuthLoading
anduseUserData
instead
- Updated dependencies [207ae38]
- @nhost/client@0.2.0