How to pass logged in user info to Intercom

<script>
    if(window['Intercom'] && window['logged_in_user'] && window['logged_in_user']['softr_user_email']) {
      window['Intercom']('update', {
        'email': window['logged_in_user']['softr_user_email'],
        'name': window['logged_in_user']['softr_user_full_name'],
        'user_id': window['logged_in_user']['airtable_record_id']
      });
    }
</script>
2 Likes

Thanks! I put it in the header and it works great

I had an issue:
When a user logs in via Intercom and sends a message, it will recognize his email and name as expected.
But if the user logs out and sends a message, it still recognizes the same email he logged in with previously. In that case, it should recognize him as a Guest