/lovable-integrations

Lovable and Intercom integration: Step-by-Step Guide 2025

Discover step-by-step instructions for integrating Lovable with Intercom to boost customer engagement and streamline support.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Lovable with Intercom?

 

Setting Up Intercom Dependencies

 
  • Create a new file called intercom.ts in your project. For example, in your project’s root or in a folder called integrations, create the file intercom.ts.
  • Since you cannot run terminal commands, no package installation is needed. All dependencies will be loaded via code by inserting Intercom’s widget script.

 

Creating the Intercom Initialization Module

 
  • Open the newly created intercom.ts file and paste the following TypeScript code. This module declares the Intercom interface on the Window object and creates a function to load the Intercom script dynamically, then initializes it with your application’s ID.

declare global {
    interface Window {
        Intercom?: any;
    }
}

export function initIntercom(appId: string): void {
    if (window.Intercom) {
        // If Intercom already exists, update the settings.
        window.Intercom('boot', { app_id: appId });
        return;
    }
    (function() {
        var w = window;
        var ic = w.Intercom;
        if (typeof ic === "function") {
            ic('reattach_activator');
            ic('update', {});
        } else {
            var d = document;
            var i: any = function() {
                i.c(arguments);
            };
            i.q = [];
            i.c = function(args: any) {
                i.q.push(args);
            };
            w.Intercom = i;
            var s = d.createElement('script');
            s.type = 'text/javascript';
            s.async = true;
            s.src = 'https://widget.intercom.io/widget/' + appId;
            var x = d.getElementsByTagName('script')[0];
            if(x.parentNode){ 
                x.parentNode.insertBefore(s, x);
            }
        }
    })();
}

 

Integrating Intercom in Your Main Application Code

 
  • Locate the file where your application first loads or initializes (for example, main.ts or app.ts).
  • At the top of this file, import the initIntercom function from your intercom.ts module.
  • Call the initIntercom function with your actual Intercom App ID. Replace YOURAPPID_HERE with the App ID from your Intercom dashboard.

// Import the Intercom initialization function
import { initIntercom } from './integrations/intercom';

// Your Intercom App ID from the Intercom dashboard
const INTERCOMAPPID = 'YOURAPPID_HERE';

// Initialize Intercom when your application starts
initIntercom(INTERCOMAPPID);

 

Updating User Information in Intercom (Optional)

 
  • If your Lovable project handles user data (e.g., after login), you can update Intercom with the user’s information.
  • Create a function to pass user details to Intercom. Add the following code in a suitable file or append it to your intercom.ts file.

export function updateIntercomUser(user: { id: string; email: string; name?: string }): void {
    if (window.Intercom) {
        window.Intercom('update', {
            appid: 'YOURAPPIDHERE', // Replace with your App ID if not globally set
            user_id: user.id,
            email: user.email,
            name: user.name,
        });
    }
}

 

Using the updateIntercomUser Function

 
  • Whenever you have user information available (for example, immediately after a user logs in), import and call the updateIntercomUser function with the user details.
  • This will ensure that Intercom displays the user information correctly.

// For example, within your user authentication or profile update code:
// import the update function
import { updateIntercomUser } from './integrations/intercom';

const currentUser = {
    id: 'user_123',
    email: '[email protected]',
    name: 'John Doe'
};

updateIntercomUser(currentUser);

 

Final Steps and Testing

 
  • Save all the changes you made to your files.
  • Ensure that the code which initializes Intercom is executed early during your app’s startup. This guarantees that Intercom is loaded before any user interactions occur.
  • Test your project in a browser. Open your application and check if the Intercom widget appears on the page. You can inspect your browser’s console for any errors if the widget does not load.

 

Summary

 
  • You added a new file (intercom.ts) that contains the code to load and initialize Intercom.
  • You imported and invoked the initialization function in your main application file, passing your Intercom App ID.
  • If needed, you updated user data in Intercom to reflect the logged-in user information.

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022