Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I arbitrarily show/hide the intercom widget with js? #320

Open
SephReed opened this issue Sep 12, 2019 · 3 comments
Open

How do I arbitrarily show/hide the intercom widget with js? #320

SephReed opened this issue Sep 12, 2019 · 3 comments

Comments

@SephReed
Copy link

Something like Intercom.show(); Intercom.hide() would be nice. What's the function call for this?

@SephReed
Copy link
Author

I found this: https://developers.intercom.com/installing-intercom/docs/intercom-javascript#section-intercomhide

This will hide the main Messenger panel if it is open. It will not hide the Messenger Launcher.

I'm trying to hide the Messenger Launcher. It gets in the way of my UI at some points. I'm not finding any function for this yet.

@SephReed
Copy link
Author

A semi functional solution is to just force it:

function setIntercomVisible(shouldShow) {
  const intercomId = "intercom-container";
  const domNode = document.getElementById(intercomId);
  if (domNode) {
    domNode.style.display = shouldShow ? "" : "none";
  } else {
    console.warn(`No element of id "${intercomId}" was found`);
  }
}

@lmansur
Copy link

lmansur commented Sep 30, 2021

If anyone is still looking for this, you can hide using the JS lib:

Intercom("update", { "hide_default_launcher": true });

Taken from https://www.intercom.com/help/en/articles/189-turn-off-show-or-hide-the-intercom-messenger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants