2. Authenticate
Autheticate your logged in users with the SDK.
Import the useIdentify Hook
Import the useIdentify
hook.
Fetch relevant user info
Create a Velt User
object.
To enable @mention
in the comments, you need to pass the user’s contacts. Learn more about how it works here.
Pass the User object to the SDK
Call the useIdentify()
hook and pass in the Velt User
object.
useIdentify()
method is asynchronous.useIdentify
within a child component of the VeltProvider
, or else it will not work.(Optional) - Add JWT Tokens for additional security
The second parameter of the useIdentify()
method is an optional configuration object that has a JWT Token
as a field.
This can be used to add an additional layer of security to prevent user impersonation.
email
address and organizationId
passed in the identify call to validate the user later to prevent unauthorized access. See JWT Tokens for more information on how to generate a JWT Token
with the Velt SDK.
(Optional) - Force re-login user on identify call
Default: false
By default when you identify a User, we maintain the user auth in the browser unless you explicitly sign out the logged in user.
If you are changing a User’s access or any metadata and want those changes to be reflected immediately,
then you should re-call the identify
method with forceReset
option set to true
.
Was this page helpful?