Skip to content
Dashboard
Open .md fileOpen llms.txtA list of every page, for AI tools

Reference

Methods

Every method on window.Iris. Calls made before iris.js loads wait in a queue.

Starts the widget on your page. Every option is in Iris.init.

index.html
Iris.init({ appId: "app_7Hq2xK9mPz" });

Signs the contact in as one of your signed-in users. token is an identity token that your server signs. See Identify users.

app.js
Iris.identify({ token });

Signs the contact out and starts a new anonymous session. Call it when the user signs out of your product.

app.js
Iris.logout();

Opens the widget. To open it from a link with no code, see Open from a link.

app.js
document.querySelector("#help").addEventListener("click", () => Iris.open());

Closes the widget and moves the focus back to where it was before the widget opened.

app.js
Iris.close();

Sets the page context: facts about where the contact is in your product, for agents and triage. Each call replaces the earlier page context. See Page context.

app.js
Iris.setPageContext({ plan: "pro", cartTotal: 42.5 });
<key>string | number | boolean | nullOptional#

Iris keeps the keys in the order you send them.

Key: up to 64 charactersString value: up to 500 characters

Example: plan: "pro"

Changes widget options after Iris.init. See Iris.update.

app.js
Iris.update({ launcher: false });
launcherbooleanOptional#

Shows the launcher. Pass false to hide it and open the widget from your own button with data-iris-open or Iris.open(). To change it later, call Iris.update.

Default: true

Example: launcher: false

Calls listener with the number of unread agent messages. See Events.

app.js
Iris.on("unread", (count) => console.log(count));