import { Client } from 'intercom-client';
import { DatabaseServerSetting } from './databaseSettings';

// Initiate Intercom on the server
const intercomTokenSetting = new DatabaseServerSetting<string | null>("intercomToken", null)

let intercomClient: any = null;
export const getIntercomClient = () => {
  if (!intercomClient && intercomTokenSetting.get()) {
    intercomClient =  new Client({ token: intercomTokenSetting.get() })
  }
  return intercomClient;
}

import Intercom from 'intercom-client';
import { DatabaseServerSetting } from './databaseSettings';

// Initiate Intercom on the server
const intercomTokenSetting = new DatabaseServerSetting<string | null>("intercomToken", null)

let intercomClient: any = null;
export const getIntercomClient = () => {
  if (!intercomClient && intercomTokenSetting.get()) {
    intercomClient =  new Intercom.Client({ token: intercomTokenSetting.get() })
  }
  return intercomClient;
}

--- 
+++ 
@@ -1,4 +1,4 @@
-import Intercom from 'intercom-client';
+import { Client } from 'intercom-client';
 import { DatabaseServerSetting } from './databaseSettings';
 
 // Initiate Intercom on the server
@@ -7,7 +7,7 @@
 let intercomClient: any = null;
 export const getIntercomClient = () => {
   if (!intercomClient && intercomTokenSetting.get()) {
-    intercomClient =  new Intercom.Client({ token: intercomTokenSetting.get() })
+    intercomClient =  new Client({ token: intercomTokenSetting.get() })
   }
   return intercomClient;
 }
Fix crash due to importing Intercom in the wrong way
