button onClick open Intercom messenger.
If we want to use react sdk then we should follow this procedure.
1st install: @intercom/messenger-js-sdk
2nd: got to this link and off Show the Messenger launcher
3rd: custom_launcher_selector: "#my_custom_link",
add ID
import React, { useEffect } from "react";
import Intercom from "@intercom/messenger-js-sdk";
function App() {
useEffect(() => {
Intercom({
app_id: "your_app_id",
custom_launcher_selector: "#my_custom_link",
});
}, []);
return (
<div className="App">
<h1>Welcome to My App</h1>
<button id="my_custom_link">
Support
</button>
</div>
);
}
export default App;