Intercom
Use Intercom for MainSDK feedback and support - access token, main.yaml, opening reports and tickets, local testing and swapping.
Intercom is one of the drivers behind feedback. Your app calls feedback.open() for a "Report a problem" button and support.ticket() to open a ticket, and the report lands in your Intercom workspace with the trace, app version, device and steps attached. Pick Intercom when your support team already answers customers there; pick the built-in driver when you only need reports in the MainSDK console.
Interfaces it serves
Pick Intercom in main.yaml for any of these. Your calls stay the same, and you can swap later.
feedbackBuilding for 0.6Driver intercom Intercom
feedback:
driver: intercomBefore you start
You need an Intercom workspace.
- Create an app in Intercom's developer hub. Apps there give you an access token for Intercom's REST API. Grant only the permissions your support flow needs, such as reading and writing conversations, tickets and contacts.
- Copy the access token. Treat it like a password: it can read your customers' conversations.
- Set up your inbox. Decide which team or inbox receives reports from your app, and the ticket types you use if your workspace uses tickets.
Store the token in your secrets manager, never in code or a committed env file.
Configure
feedback:
driver: intercom
# [to be decided] key name; the token goes in as secret:INTERCOM_ACCESS_TOKEN (suggested name)Provider keys go in as secret:NAME references; a literal key fails mainsdk check with MAIN-CONFIG-0004. The exact key names for the Intercom driver are not decided yet.
Use it
"use client";
import { feedback } from "mainsdk";
export function ReportButton({ user }: { user: { id: string } }) {
return (
<button onClick={() => feedback.open({ for: user, context: { screen: "checkout" } })}>
Report a problem
</button>
);
}support.ticket() opens a ticket in Intercom with the same trace and version attached. Its arguments arrive with the spec.
Local development and testing
- No Intercom workspace: use the built-in driver in a development overlay, so reports stay in your app while you build.
- Tests:
createTestApp()from@mainsdk/testingrunsfeedbackon an in-memory fake, so tests open no real conversations, andchaos.on("feedback", { outage: true })simulates Intercom being down.
feedback:
driver: builtinWhat MainSDK adds on top
- Screenshots redacted before they leave the device.
- Support access to a user's data audited.
- Every report carries the trace, version, device and steps, grouped with the matching error.
- Replies go back to the customer through
notify.
See Feedback and support for the full contract.
Limits and notes
- Planned driver, not in a spec yet:
feedbackis phase 2. - Reports carry personal data. Intercom offers more than one data hosting region; pick the one that matches where your users' data must stay (MainSDK regions are US, EU and India).
- Capturing reports is free. MainSDK Cloud Teams adds inbox history and triage of reports.
Swap to or from it
feedback:
driver: zendesk # was intercomYour feedback.open() and support.ticket() calls stay the same. Past conversations and tickets stay in Intercom; MainSDK does not move them.
FAQ
Does this replace the Intercom Messenger? No. The driver sends reports and tickets into Intercom. How it relates to a Messenger you already embed is not specified yet.
Can I send reports to Intercom and keep them in the MainSDK console? The console inbox is part of MainSDK Cloud Teams; whether it mirrors reports sent to a third-party driver is not decided yet.
Next
Open questions
Was this page helpful?