@supy-io/ngx-intercom
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.
STABLE VERSION
master
is now hosting the latest stable version of @supy-io/ngx-intercom
.
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!
Installation
This package is on NPM, so just run
$ npm install @supy-io/ngx-intercom@latest
Configuration
- 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
.
import { IntercomModule } from '@supy-io/ngx-intercom';
@NgModule({
imports: [
...
IntercomModule.forRoot({
appId: <your_app_id>,
updateOnRouterChange: true
})
...
]
})
export class AppModule { }
- Use in your components/directives/whatever you want!
import { Component, OnInit } from '@angular/core';
import { Intercom } from '@supy-io/ngx-intercom';
@Component({
selector: 'app',
template: `...`
})
export class AppComponent implements OnInit {
constructor(
public intercom: Intercom
){}
ngOnInit() {
this.intercom.boot({
app_id: <app_id>,
widget: {
"activator": "#intercom"
}
});
}
}
Development
To run live testing: ng test
To run tests: npm test
To run distribution: npm run build:dist
To publish npm run build:dist && npm publish ./dist
Credits
Maintained by Scott Wyatt and Wilson Hobbs in 2017 with contributions from Florian Reifschneider, Devon Sams, Humberto Rocha, and Luca GOUTY