Tori
  • Documentation
  • Pricing
Sign InSign Up
  • Getting started
  • Tori JavaScript guides
    • Add Tori to your site
    • Logged-in users
    • Google Tag Manager
    • Control the popup
    • Control conversations
    • Sizing and styling
  • Understanding Tori
    • Knowledge and research
    • Instructions and customisation
    • Conversations and context
    • Working with humans
  • Tori JavaScript reference
    • <tori-popup>
    • <tori-chatbox>
  • Default behaviour
    • Replies and language
    • Clarifying questions
    • Research and answers
    • Escalation
    • Staff messages and instructions
    • Off-topic questions and misuse

Control the popup

The popup includes its own launcher by default:

<script type="module" src="https://asktori.ai/cdn/tori-latest.js"></script>

<tori-popup
  app-id="APP_ID"
  agent-id="AGENT_ID"
></tori-popup>

Start open

<tori-popup
  app-id="APP_ID"
  agent-id="AGENT_ID"
  open
></tori-popup>

Hide the default launcher

Use show-launcher="false" when you want to open the popup from your own button:

<button id="open-support">Ask Tori</button>

<tori-popup
  id="support-popup"
  app-id="APP_ID"
  agent-id="AGENT_ID"
  show-launcher="false"
></tori-popup>

Then control the open property:

<script>
  const popup = document.getElementById("support-popup");

  document.getElementById("open-support").addEventListener("click", () => {
    popup.open = true;
  });
</script>

Listen for open changes

Assign onOpenChange as a JavaScript property:

<script>
  const popup = document.querySelector("tori-popup");

  popup.onOpenChange = (open) => {
    console.log("Tori popup open:", open);
  };
</script>

Function-valued options must be set as JavaScript properties. They cannot be represented as HTML attributes.

Tori

Here you can add a description about your company or product

© Copyright 2026 AskTori. All Rights Reserved.

About
  • Contact
Product
  • Documentation
Legal
  • Terms of Service
  • Privacy Policy
  • Cookie Policy