User IDs are important for Frigade to keep track of your users. If you don’t provide a user ID, Frigade will generate a guest user id for you.
User IDs can be provided at time of render in the <FrigadeProvider />
component or at any time using the setUserId
method:
If you want to set properties in the same call, you can do so by using the setUserIdWithProperties
method:
When setting user properties, Frigade automatically detects and stores the following fields on the user:
firstName
lastName
email
organization
Frigade will generate a guest user ID for you if you do not provide a user id. This ID is stored in the user’s browser using localStorage
.
This allows unauthenticated users to have state in Frigade Flows and to be able to continue their session when they return to your application.
Often it is useful to link a guest session to a user when they register or log in and transfer all state and data. The linkExistingGuestSessionToUser(userId: string)
method enable this functionality for you: