Skip to main content

How to integrate intercom in angular 15 app ?

   


Hi @Johannes Wallner,  It’s Mat from the Support Engineering Team 😀

To integrate Intercom in an Angular 15 app, you should start by including the Intercom JavaScript library file in your HTML head element. The code snippet provided in the documentation needs to be customized with your unique workspace ID, referred to as APP_ID in the code. After this initial setup, when you have a logged-in user on your site, you should make a call to window.Intercom('boot', {app_id: APP_ID, ...other attributes}) with the user's details. This is a necessary step for single-page applications like those built with Angular, which are characterized by few page refreshes and lots of asynchronous JavaScript. For complete details, you can refer to the documentation on integrating Intercom in a single-page app. Additionally, the linked documentation provides further instructions and best practices for integrating Intercom in a SPA environment.

 


To integrate Intercom in an Angular 15 app, include the Intercom JavaScript library in your HTML `<head>` element. Replace `APP_ID` in the provided code with your unique workspace ID. Then, call `window.Intercom('boot', {app_id: APP_ID, ...user details})` when a user logs in, as this is essential for SPAs like Angular, where page refreshes are rare. For detailed instructions, refer to the official Intercom SPA integration documentation.


Reply