Intercom integration with Discourse?

Hello all,

I have Intercom ( on my discourse site and I want to auto populate the email address as the user is already logged in with their email to the discouse forum (as its a closed community)

Intercom offer the following code in Ruby:

I’m guessing I cant use any server side code within the admin/customization panel in discourse its self but I am wondering if any one else has solved this problem before?

Thanks in advance, I really appreciate all responses.


1 Like

Look at the #howto topics about developing themes.

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

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

        window.intercomSettings = {
            app_id: '[APP_ID]',
            email: useremail,
            name: currentname,
            created_at: createdatuser,
            "discourse_username": userusername,

@Rob_Jeffrey have a look at our official Intercom plugin topic


Thanks for your reply! This worked great, genius

Ah great to know, in future discourse installs I will use the official plugin

We have also released some days ago a theme component for Intercom, you can take a look here