Intercom integration with Discourse?

Hi Rob, I think you can do it if you add variables to the script, for example:

<script>
$.getJSON("/session/current.json", function(json) {
    var userusername = String(json.current_user.username);
    var currentname = String(json.current_user.name);
    var pathtojson = "/users/" + userusername + ".json";
    $.getJSON(pathtojson, function(json){
        var useremail = String(json.user.email);
        var createdatuser = String(json.user.created_at);

        window.intercomSettings = {
            app_id: '[APP_ID]',
            email: useremail,
            name: currentname,
            created_at: createdatuser,
            "discourse_username": userusername,
        };
    });
});
</script>