Get your dream built 10x faster

Replit and Intercom Integration: 2026 Guide

We build custom applications 5x faster and cheaper 🚀

Book a Free Consultation
4.9
Clutch rating 🌟
600+
Happy partners
17+
Countries served
190+
Team members
Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Stuck on an error? Book a 30-minute call with an engineer and get a direct fix + next steps. No pressure, no commitment.

Book a free consultation

How to Integrate Replit with Intercom

To integrate Replit with Intercom, you treat Intercom exactly like any other external SaaS: you call its REST APIs using your Intercom Access Token, and you expose a webhook endpoint from your Repl for Intercom to POST data to. Replit doesn’t provide any special Intercom plugin, so everything is done with normal HTTP, environment variables, and a small server you run inside the Repl. In practice, you store your Intercom access token in Replit Secrets, write a small backend (Node or Python) to talk to Intercom's REST API, and expose an endpoint that Intercom can call for events such as user-created, conversation-created, or message-replied.

 

Core Idea (Direct Answer)

 

The real, working way to integrate Replit with Intercom is: store your Intercom Access Token in Replit Secrets, create a backend service in your Repl (for example Node.js with Express), call Intercom’s REST API to send messages or fetch conversations, and expose a webhook route (for example /intercom/webhook) so Intercom can send event notifications back into your Repl. You must keep your Repl running during testing so Intercom can reach it, and you map a public port exactly as Replit provides it (usually through the main web server). Everything is explicit HTTP.

 

What You’ll Use

 

  • Intercom Access Token — created in Intercom at Settings → Developers → Access Tokens. This is how you authenticate to their REST API.
  • Replit Secrets — to store the token as an environment variable (for example INTERCOM\_TOKEN).
  • A simple web server — Node.js Express is easiest. Must listen on 0.0.0.0.
  • HTTP requests — Intercom uses standard REST JSON APIs.
  • Webhook endpoint — a route Intercom can POST to, so your Repl receives real-time events.

 

Step‑by‑Step Setup

 

This is the cleanest, most reliable workflow for beginners and junior devs.

  • Create a Repl (Node.js recommended). Replit gives you a public URL automatically once your server is running.
  • Add Intercom token in “Secrets”:
    KEY: INTERCOM\_TOKEN
    VALUE: (your real Intercom access token)
  • Install dependencies:
    Express (to run a server)
    Axios (to call Intercom APIs)
  • Build a minimal server that:
    • Responds to GET / so you know it runs
    • Implements POST /intercom/webhook for incoming events
    • Has helper routes you create to talk to Intercom’s REST API
  • Configure your webhook in Intercom (Settings → Developers → Webhooks) pointing to your Repl URL + /intercom/webhook.
  • Test live — Intercom will only reach your webhook while your Repl is running.

 

Minimal Working Node.js Integration

 

// index.js

import express from "express";
import axios from "axios";

const app = express();
app.use(express.json()); // Parse JSON bodies

const INTERCOM_TOKEN = process.env.INTERCOM_TOKEN; // Loaded from Replit Secrets

// Helper: call Intercom REST API
async function intercomRequest(method, url, data) {
  return axios({
    method,
    url: "https://api.intercom.io" + url,
    data,
    headers: {
      Authorization: `Bearer ${INTERCOM_TOKEN}`,
      "Content-Type": "application/json",
      Accept: "application/json"
    }
  });
}

// Basic sanity check
app.get("/", (req, res) => {
  res.send("Intercom integration is running.");
});

// Example: Send a message to a user
app.post("/send-message", async (req, res) => {
  try {
    const { email, message } = req.body;

    const response = await intercomRequest("post", "/messages", {
      message_type: "inapp",
      body: message,
      from: { type: "admin", id: "YOUR_ADMIN_ID" }, // Replace with real admin ID from Intercom
      to: { type: "user", email: email }
    });

    res.json({ ok: true, intercomResponse: response.data });
  } catch (err) {
    console.error(err);
    res.status(500).json({ error: "Failed to send message" });
  }
});

// Webhook endpoint for Intercom
app.post("/intercom/webhook", (req, res) => {
  console.log("Received Intercom webhook:", req.body);

  // IMPORTANT: Intercom expects 200 OK quickly.
  res.status(200).send("OK");

  // You can add any logic you want here — logging, replying, storing data, etc.
});

// Start server — must bind to 0.0.0.0 for Replit
app.listen(3000, "0.0.0.0", () => {
  console.log("Server running on port 3000");
});

 

How to Wire the Webhook in Intercom

 

Intercom needs your server’s public URL. When your Repl is running, Replit gives you something like:

https://your‑repl‑name.username.repl.co

In Intercom’s dashboard:

  • Go to Settings → Developers → Webhooks
  • Add: https://your‑repl‑name.username.repl.co/intercom/webhook
  • Choose events you want (for example: user.created, conversation.user.created)
  • Save

Intercom will immediately try POST requests. Watch your Repl console to see them arrive.

 

Important Things to Understand

 

  • Your Repl must be running for Intercom to deliver webhooks. If it sleeps or stops, the webhook fails.
  • Statefulness: if you need persistence (logging events, syncing users), use an external DB (for example: Supabase, Firestore, Postgres at Neon) rather than local filesystem storage.
  • Token Safety: never hardcode your Intercom Access Token. Always use Replit Secrets.
  • Admin IDs: Intercom requires a real admin ID when sending admin-to-user messages. You get this from the Intercom dashboard under "Admins".
  • No special SDK needed: Intercom does not require any special SDK; REST endpoints work perfectly.

 

Typical Use Cases on Replit

 

  • Trigger Intercom messages when a user performs something inside your Repl-based project.
  • Sync your app’s users to Intercom by calling their /contacts API.
  • Listen for conversation events so your app updates in real time.
  • Build lightweight automation, for example replying automatically to certain Intercom message types.

 

That’s the real, production-valid way to integrate Replit with Intercom — explicit REST calls, explicit webhook routes, env vars in Secrets, and a small server running on 0.0.0.0.

Use Cases for Integrating Intercom and Replit

1

Lead Capture Widget → Replit Backend

An app running on Replit can receive lead data from an Intercom Messenger widget embedded in your frontend. When a visitor submits info, your JavaScript app sends it to your Replit backend, which then calls the Intercom REST API using your Intercom Access Token stored in Replit Secrets. This creates or updates a contact inside Intercom. It’s a simple flow that turns website activity into structured CRM data.

  • Your Replit app runs on 0.0.0.0 with an exposed port so the widget can reach it.
  • Contact creation uses a normal Intercom REST POST request.
// Express server running inside Replit
import express from "express"
import fetch from "node-fetch"

const app = express()
app.use(express.json())

app.post("/lead", async (req, res) => {
  const token = process.env.INTERCOM_ACCESS_TOKEN
  const { email, name } = req.body

  const resp = await fetch("https://api.intercom.io/contacts", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${token}`,
      "Accept": "application/json",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ email, name })
  })

  res.json(await resp.json())
})

app.listen(3000, "0.0.0.0")

2

Lead Capture Widget → Replit Backend

Intercom can send webhooks to your Replit backend whenever a user starts a conversation, replies, or gets tagged by support. Your Replit service listens on a public URL, verifies the webhook signature, and triggers internal automations like updating your database, posting into Slack, or running a Replit Workflow. This turns Intercom events into backend actions without manual effort.

  • Webhook signing secret stored in Replit Secrets.
  • Replit app must stay running to receive live events.
// Basic webhook listener
app.post("/intercom/webhook", (req, res) => {
  // Normally you'd verify signature here
  const event = req.body
  console.log("Intercom event received:", event.type)

  // Trigger custom automation...
  res.status(200).send("ok")
})

3

Internal Tools Dashboard Using Intercom Data

You can build an internal dashboard hosted on Replit that fetches live Intercom data via the Intercom REST API. Support agents log into your tool (simple session auth or OAuth), and the dashboard displays users, conversations, and tags. Since Intercom has a stable JSON API, your Replit server fetches data on demand and renders it in your frontend, acting as a lightweight internal CRM layer.

  • All API calls use backend code, keeping tokens secret.
  • Useful for teams without budget for full internal CRM tooling.
// Fetch recent conversations
async function getConversations() {
  const token = process.env.INTERCOM_ACCESS_TOKEN
  const r = await fetch("https://api.intercom.io/conversations", {
    headers: { "Authorization": `Bearer ${token}", "Accept": "application/json" }
  })
  return r.json()
}

Book Your Free 30‑Minute Migration Call

Speak one‑on‑one with a senior engineer about your no‑code app, migration goals, and budget. In just half an hour you’ll leave with clear, actionable next steps—no strings attached.

Book a Free Consultation

Troubleshooting Intercom and Replit Integration

1

Why is the Intercom widget not loading inside a Replit deployed web app?

The Intercom widget usually fails on Replit because the deployed app runs on a repl.co domain using an iframe‑based preview, and Intercom blocks loading when the domain isn’t added to your Intercom Allowed Domains. Intercom also refuses to run inside frames for security, so the widget only loads when you open the Deployment’s public URL directly, not the Replit editor preview.

 

What’s Actually Happening

 

Intercom validates the page’s origin. If your Replit URL (for example, https://yourapp.repl.co) isn’t listed in your Intercom settings, the widget silently aborts. Inside the Replit editor, your app is inside a sandboxed frame, which Intercom intentionally blocks. You must open the live Deployment URL in a new browser tab.

  • Add the public .repl.co domain to Intercom’s Allowed Domains.
  • Test using the real deployed URL, not the Replit preview.

 

<script>
  window.intercomSettings = { app_id: "YOUR_APP_ID" };
</script>
<script src="https://widget.intercom.io/widget/YOUR_APP_ID"></script>

2

How to properly set Intercom environment variables in the Replit Secrets panel?

You set Intercom environment variables in Replit by opening the Secrets panel and creating keys that match the variable names your code expects, such as INTERCOM_ACCESS_TOKEN. Replit then injects them into process.env at runtime, so your app can read them without hard‑coding sensitive data.

 

How to Set Intercom Secrets Properly

 

In the Replit workspace, open Tools → Secrets. Add each Intercom value as a separate key. Keep names simple and uppercase, because your backend will read them exactly as typed. Intercom typically gives you an access token or client credentials depending on your API flow.

  • Create INTERCOM_ACCESS_TOKEN and paste your token into the value field.
  • Click Add secret; Replit stores it securely and exposes it only at runtime.
  • Use process.env in Node.js to access it inside your server code.

 

const intercomToken = process.env.INTERCOM_ACCESS_TOKEN // pulled from Replit Secrets

 

This keeps your Intercom credentials safe, avoids committing them to Git, and works reliably across Repls and Deployments.

3

Why does Intercom JavaScript code fail when added to the Replit HTML/CSS/JS template?

Your Intercom script fails in the basic Replit HTML/CSS/JS template because that template is a static file preview, not a real server. Intercom loads through remote scripts, cookies, and dynamic DOM injection, and the preview isolation blocks or delays these behaviors, so the widget never initializes.

 

Why it breaks

 

The HTML/JS Repl serves files from a sandboxed iframe, so third‑party scripts cannot freely set cookies or run cross‑origin requests. Intercom’s loader expects a normal browser context, but Replit’s preview wraps your page, causing blocked requests and missing global window events.

  • Intercom uses external script tags that the iframe often blocks.
  • Replit preview hides the real URL, so Intercom’s domain checks fail.

 

<script>
window.intercomSettings={app_id:"xyz"} // Loads but can't initialize inside iframe
</script>
Book a Free Consultation

Schedule a 30‑Minute No‑Code‑to‑Code Consultation

Grab a quick video call to discuss the fastest, most cost‑efficient path from no‑code to production‑ready code. Zero sales fluff—just practical advice tailored to your project.

Contact us

Common Integration Mistakes: Replit + Intercom

Missing Webhook Verification

Intercom signs every webhook, but many Replit apps skip verifying the signature. Without checking the X-Hub-Signature header using your Intercom secret (stored in Replit Secrets), your endpoint accepts forged requests. Replit restarts also mean your server must re‑bind on port 0.0.0.0 and still verify signatures on every request.

  • Always verify the HMAC signature before trusting the payload.
// Example verification in Express
import crypto from "crypto";
import express from "express";

const app = express();
app.use(express.raw({ type: "*/*" })); // Webhooks must use raw body

app.post("/intercom/webhook", (req, res) => {
  const secret = process.env.INTERCOM_SECRET; // stored in Replit Secrets
  const sig = req.headers["x-hub-signature"];

  const expected = "sha1=" + crypto
    .createHmac("sha1", secret)
    .update(req.body)
    .digest("hex");

  if (sig !== expected) return res.status(401).send("invalid signature");
  res.send("ok");
});

app.listen(3000, "0.0.0.0");

Using Repl URL Instead of a Stable Deployment URL

Intercom webhooks need a stable public HTTPS URL, but the default Repl preview URL changes and sleeps. That breaks delivery. Developers accidentally register this temporary URL in Intercom, causing silent webhook failures. You must deploy or use an Always‑On Deployment so your endpoint stays reachable.

  • Register only static deployment URLs in Intercom’s webhook settings.

Forgetting to Persist Intercom Tokens

Intercom OAuth tokens must survive Replit restarts. Storing them in files within the Repl’s ephemeral filesystem or global variables causes token loss. Replit resets these on rebuild. Instead, store the client secret in Replit Secrets and persist user‑level OAuth tokens in an external DB (Supabase, Postgres, or KV) you control.

  • Never rely on in‑Repl files for production token persistence.

Not Handling Intercom Rate Limits

Intercom applies strict API rate limits, but many Replit integrations fire API calls synchronously in request handlers. Under traffic or webhook bursts, this triggers 429 errors. Replit’s single-process runtime amplifies this. Queue calls or add retry/backoff logic to avoid dropping messages or user events.

  • Implement retry with delay when receiving 429 responses.

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


Recognized by the best

Trusted by 600+ businesses globally

From startups to enterprises and everything in between, see for yourself our incredible impact.

RapidDev 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.

Arkady
CPO, Praction
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!

Donald Muir
Co-Founder, Arc
RapidDev 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.

Mat Westergreen-Thorne
Co-CEO, Grantify
RapidDev is an excellent developer for custom-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.

Emmanuel Brown
Co-Founder, Church Real Estate Marketplace
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!

Samantha Fekete
Production Manager, Media Production Company
The pSEO strategy executed by RapidDev is clearly driving meaningful results.

Working with RapidDev has delivered measurable, year-over-year growth. Comparing the same period, clicks increased by 129%, impressions grew by 196%, and average position improved by 14.6%. Most importantly, qualified contact form submissions rose 350%, excluding spam.

Appreciation as well to Matt Graham for championing the collaboration!

Michael W. Hammond
Principal Owner, OCD Tech

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We’ll discuss your project and provide a custom quote at no cost.Â