Setting custom attributes

Hi. I’m trying to send user attributes from my app to tawk.to so that I could see user name and email in Tawk UI, but for some reason it doesn’t seem to work.

Code:

Any ideas what I’m doing wrong?

I tried setting Tawk_API.visitor directly, but that didn’t work and generated js errors
Prior to this code I tried various hashings, and login generated 403 errors. Current one seems to work, but still, attributes are not set.