Add missing Intercom method: getVisitorId

This commit is contained in:
Samer Albahra
2018-09-21 23:29:24 -05:00
parent 5f9013a234
commit cdd78b1eb4
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -43,7 +43,8 @@ declare namespace Intercom_ {
| 'onShow'
| 'onUnreadCountChange'
| 'onActivatorClick'
| 'trackEvent';
| 'trackEvent'
| 'getVisitorId';
interface IntercomStatic {
(command: 'boot', param: IntercomSettings): void;
@@ -53,6 +54,7 @@ declare namespace Intercom_ {
(command: 'onHide' | 'onShow' | 'onActivatorClick', param?: () => void): void;
(command: 'trackEvent', tag?: string, metadata?: any): void;
(command: 'onUnreadCountChange', cb: (unreadCount: number) => void): void;
(command: 'getVisitorId'): string;
(command: IntercomCommand, param1?: any, param2?: any): void;
}
}
+1
View File
@@ -26,6 +26,7 @@ Intercom('onHide', () => { /* Do stuff */ });
Intercom('onUnreadCountChange', (unreadCount: number) => { /* Do stuff */ });
Intercom('onActivatorClick', () => { /* Do stuff */ });
Intercom('trackEvent', 'invited-friend');
const visitorId = Intercom('getVisitorId');
const metadata = {
invitee_email: 'pi@example.org',