User authentication mode provides a seamless experience for a business and for a customer across different devices. It offers continuity across web, iOS and Android platforms and lets you keep all interactions with a given customer in the same chat thread, no matter what device he/she is logged in from.
User authentication mode also helps make sure that one user can’t impersonate another and therefore we strongly recommend all our clients to enable this mode.
The most common usage of the User authentication mode is to integrate it with your registration/login system. You can install HelpCrunch chat widget on your landing page to chat with your visitors, for example, and inside your service (in-app messenger) to support your registered users.
Once your visitor registers/logs in with your service and gets a User ID in your database, you can enable the User authentication mode for that user. After that, such users will automatically appear in the "Contacts" section even if they had no chats with you previously, and you can reach out to them first.
The simplest way of doing user authentication
Example of the full widget code together with the user auth mode and custom data:
helpcrunchSettings has next parameters:
- organization: string (required)
- appId: sting
- user: object (see below)
user object parameters
- user_id: string
- name: string
- email: string
- phone: string
- company: string
1. user_id attribute must be unique (i.e. not available for other users) as someone might get access to the conversation knowing it.
2. To be sure no one substitutes the user ID to view another person’s chat history and chat under their name, hash your user Ids with the hash salt and put this hash to user_id field instead of a real ID.
custom data object parameters:
Here you can send any additional user information, like subscription type, number of payments, registration or order dates, etc...
1. Create custom attributes in HelpCrunch settings
2. Update custom attributes during the user authentication, or later.