{"id":15638869,"url":"https://github.com/patrickjs/angular-intercom","last_synced_at":"2026-03-11T17:01:22.087Z","repository":{"id":57178587,"uuid":"14153614","full_name":"PatrickJS/angular-intercom","owner":"PatrickJS","description":"An Angular.js wrapper for Intercom.io providing a simple and familiar API for Angular Developer.","archived":false,"fork":false,"pushed_at":"2017-07-17T21:54:21.000Z","size":62,"stargazers_count":89,"open_issues_count":8,"forks_count":36,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-09T21:50:48.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatrickJS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-05T20:44:25.000Z","updated_at":"2024-04-01T09:28:01.000Z","dependencies_parsed_at":"2022-09-09T19:00:12.871Z","dependency_job_id":null,"html_url":"https://github.com/PatrickJS/angular-intercom","commit_stats":null,"previous_names":["gdi2290/angular-intercom"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/PatrickJS/angular-intercom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-intercom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-intercom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-intercom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-intercom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickJS","download_url":"https://codeload.github.com/PatrickJS/angular-intercom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickJS%2Fangular-intercom/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264638590,"owners_count":23642179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T11:23:34.764Z","updated_at":"2025-12-12T02:54:40.192Z","avatar_url":"https://github.com/PatrickJS.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# angular-intercom [![Build Status](https://travis-ci.org/gdi2290/angular-intercom.png?branch=master)](https://travis-ci.org/gdi2290/angular-intercom)\nAn Angular.js wrapper for Intercom.io providing a simple and familiar API for Angular Developer. I also added a asynchronous loading option \u003ccode\u003e$intercomProvider.asyncLoading(true)\u003c/code\u003e to allow anyone to quickly drop in and start using Intercom. This is great for startups who need a quick and easy way to interact with their customers\n\n\n# How do I add this to my project?\nYou can download `angular-intercom` by:\n\n* (prefered) Using bower and running `bower install angular-intercom --save`\n* Using npm and running `npm install angular-intercom --save`\n* Downloading it manually by clicking here to download development [(unminified)](https://cdn.rawgit.com/gdi2290/angular-intercom/master/angular-intercom.js) [(minified)](https://cdn.rawgit.com/gdi2290/angular-intercom/master/angular-intercom.min.js)\n* CDN `https://cdn.rawgit.com/gdi2290/angular-intercom/master/angular-intercom.min.js`\n\n# Example\nHere is a simple [Example App](https://gdi2290.net/angular-intercom/example/) which allows you to include your own `app_id` to test. Below is a quick start guide. Use either `$intercom` or `Intercom` service depending on your preference and opinions.\n````html\n\u003c!-- I'm using angular 1.3.8+ but any version should work --\u003e\n\u003cscript src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.js\"\u003e\u003c/script\u003e\n\n\n\u003c!-- \nYou can include Intercom's script manually just make sure you add your app_id\n\u003cscript async defer src=\"https://widget.intercom.io/widget/\u003c%= INTERCOM_APPID %\u003e\"\u003e\u003c/script\u003e\n--\u003e\n\n\u003c!-- \nOr you can include Intercom sdk as you normally would\n\u003cscript\u003e\n(function(){var w=window;var ic=w.Intercom;if(typeof ic===\"function\"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;\n\ns.src='https://widget.intercom.io/widget/\u003c%= INSERT APP_ID HERE %\u003e';\n\nvar x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()\n\u003c/script\u003e\n--\u003e\n\u003c!-- \nOr you can ask the module to load the script for you (see below) \n--\u003e\n\n\u003c!-- include this module after angular.js --\u003e\n\u003cscript src=\"app/bower_components/angular-intercom/angular-intercom.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n  angular.module('intercomApp', [\n    'ngIntercom' // or you can use 'angular-intercom'\n  ])\n  .value('fakeUser', {\n    email: 'john.doe@example.com',\n    name: 'John Doe',\n    created_at: 1234567890,\n    user_id: '9876'\n  })\n\n  // inject your app_id anyway you like\n  .constant('INTERCOM_APPID', 'd0idn8ii')\n\n  // Configure your $intercom module with appID\n  .config(function($intercomProvider, INTERCOM_APPID) {\n    // Either include your app_id here or later on boot\n    $intercomProvider\n      .appID(INTERCOM_APPID);\n\n    // you can include the Intercom's script yourself or use the built in async loading feature\n    $intercomProvider\n      .asyncLoading(true)\n  })\n  .run(function($intercom, fakeUser) {\n    // boot $intercom after you have user data usually after auth success\n    $intercom.boot(fakeUser); // app_id not required if set in .config() block\n  })\n  //                                       Intercom // you may use Intercom rather than $intercom\n  .controller('MainCtrl', function($scope, $intercom, fakeUser) {\n\n    $scope.user = fakeUser;\n\n    // Register listeners to $intercom using '.$on()' rather than '.on()' to trigger a safe $apply on $rootScope\n    $intercom.$on('show', function() {\n      $scope.showing = true; // currently Intercom onShow callback isn't working\n    });\n    $intercom.$on('hide', function() {\n      $scope.showing = false;\n    });\n\n\n\n    $scope.show = function() {\n      $intercom.show();\n    };\n\n    $scope.hide = function() {\n      $intercom.hide();\n    };\n\n    $scope.update = function(user) {\n      $intercom.update(user);\n    };\n\n  });\n\n\u003c/script\u003e\n````\n\n# Require.js/AMD\n`angular-intercom` is provides a Require.js/AMD interface, however it works differently depending on if you are using \n`$intercomProvider.asyncLoading(true)`or not.\n\nIf you are using `$intercomProvider.asyncLoading(true)`, then *don't* specify the `\"intercom\"` dependency at all, just load\n`\"angular_intercom\"` in paths, i.e.\n\n```javascript\npaths: {\n  \"angular_intercom\": '/somePath/angular-intercom/angular-intercom'\n}\n```\n\nIf you wish to load the intercom library through Require.js/AMD rather than using `$intercomProvider.asyncLoading(true)`, you first\nneed to find the CDN url provided by intercom.io. To do this, curl the url you received from intercom.io during intercom.io setup\n\n```\ncurl https://widget.intercom.io/widget/INTERCOM_APPID\n```\n\nYou should get something like \n```html\n\u003chtml\u003e\u003cbody\u003eYou are being \u003ca href=\"https://js.intercomcdn.com/intercom.xxxxxxx.js\"\u003eredirected\u003c/a\u003e.\u003c/body\u003e\u003c/html\u003e\n```\n\nThis means your CDN url is `https://js.intercomcdn.com/intercom.xxxxxxx.js`. Now in your paths for require.js, \nyou would have something like this (remember to remove the `.js` at the end of the CDN url)\n\n```javascript\npaths: {\n  \"intercom\": \"https://js.intercomcdn.com/intercom.xxxxxxx\",\n  \"angular_intercom\": '/somePath/angular-intercom/angular-intercom'\n}\n```\n\nAnd in your shim, you would do this\n\n```javascript\nshim: {\n  \"angular_intercom\": [\"intercom\"]\n}\n```\n\nWhen `\"intercom\"` loads, it will attach itself to `window`, which will automatically be detected by angular-intercom\n\nThen you can just use \"angular_intercom\" as any other `Require.js/AMD` module definition, i.e.\n\n```javascript\ndefine(['angular', 'angular_intercom'], function(angular, angular_intercom) {\n  // Bootstrap angular here\n});\n```\n\n# Node.js\n\nIn node.js, angular-intercom will try and require a `intercom` dependency. If this fails, it will expect the `Intercom`\nobject to exposed via the `global` object\n\n# Intercom.io\n![](https://marketing.intercomcdn.com/assets/squarespace/screens/04-f880111f72c193cc0a4555d441a714d6.jpg)\nWhat is Intercom? An entirely new way to connect with your customers. Intercom shows you who is using your product and makes it easy to personally communicate with them through targeted, behavior-driven email and in-app messages.\n\n# Changelog\nPlease see [changelog](https://github.com/gdi2290/angular-intercom/blob/master/CHANGELOG.md) for recent updates\n\n# License\n[MIT](https://github.com/gdi2290/angular-intercom/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fangular-intercom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickjs%2Fangular-intercom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickjs%2Fangular-intercom/lists"}