Use nhost.auth.onTokenChanged to add a custom function that runs every time the access or refresh token is changed.

nhost.auth.onTokenChanged(() =>
  console.log('The access and refresh token has changed')
)

Parameters


fn required OnTokenChangedFunction