[](https://www.npmjs.com/package/ng-intercom-x) [](https://www.npmjs.com/ng-intercom-x)
npm install ng-intercom-x

[//]: # ([![Build status][ci-image]][ci-url])
![Maintenance]()
This is an Intercom wrapper for Angular 2+ which supports AoT and SSR.
It intends to support all documented intercom methods and PRs for functionality is greatly appreciated.
master is now hosting the latest stable version of ng-intercom-x.
If you find issues with this version, please file an issue as soon as possible so we can take a look at it. We appreciate your cooperation!
This package is on NPM, so just run
``sh`
$ npm install ng-intercom-x@latest
1. Import IntercomModule to app.module.ts. The module will automatically include the APP_ID instantiation, so you DO NOT need to copy the install script from Intercom and place it in your index.html.
`ts
import { IntercomModule } from 'ng-intercom-x';
@NgModule({
imports: [
...
IntercomModule.forRoot({
appId:
updateOnRouterChange: true // will automatically run update on router event changes. Default: false`
})
...
]
})
export class AppModule { }
2. Use in your components/directives/whatever you want!
`ts
// App
import { Component, OnInit } from '@angular/core';
import { Intercom } from 'ng-intercom-x';
@Component({
selector: 'app',
template: ...
})
export class AppComponent implements OnInit {
constructor(
public intercom: Intercom
){}
ngOnInit() {
this.intercom.boot({
app_id:
// Supports all optional configuration.
widget: {
"activator": "#intercom"
}
});
}
}
`
To run tests:
npm testTo run distribution:
npm run build:distTo publish
npm run build:dist && npm publish ./dist`
[ci-image]: https://img.shields.io/circleci/project/github/CaliStyle/ng-intercom-x/master.svg
[//]: # ([ci-url]: https://circleci.com/gh/CaliStyle/ng-intercom-x/tree/master)