Providing customer details
By default, customers chatting with you will be anonymous. You can pass customer details, if you know them, in thePlain.init
function call:
Matching chat users to existing customers
If you want to match the customer to an existing customer in your workspace, you will need to pass their email. To avoid security issues around impersonation you will also need to provide the email address hashed using a shared secret. You can generate this secret in the Chat settings page in the Plain app. Once you have this secret, you can calculate the hash. This must be done in backend code to avoid leaking the secret. If your secret is leaked malicious users will be able to impersonate your customers in chats. Backend code:Customer verification
If you want to see the name and email of customers who get in touch via chat you can require them to provide their details by settingrequireAuthentication
to true in Plain init:
emailHash
is already set in customerDetails
, then the verification screen will not appear since the customer has already been authenticated.