Home | Chat with custom field

Front Chat

This chat widget is configured to only permit chats when an identified userHash is provided. A pre-calculated hash is provided for the given email and a value passed to the custom field Number.



Code used on this page:

<input type="text" id="number"><button onclick="updateNumber()">Update number</button>
<script src="https://chat-assets.frontapp.com/v1/chat.bundle.js"></script>
<script>
  window.FrontChat('init', {
    chatId: 'c96a4f103123656ef521913979693b0c', 
    useDefaultLauncher: true,
    email: 'support@frontapp.com',
    userHash: 'b893b9a4f65ed22d523c6a56123399c0c3565b6f6a25bf2ad28086b643711455',
    customFields: {
        Number: 11
    }
  });

  function updateNumber() {
    const number = parseInt(document.getElementById("number").value);
    
    if(number) {
      window.FrontChat('identity', {
        customFields: {
          Number: number
       }
      });
    } 
  }
</script>