embed-javascript-events-api
Installation
SKILL.md
Looker Embed JavaScript Events
This skill enables agents to assist users in implementing and troubleshooting interactive communication between a host application and an embedded Looker iframe using JavaScript events.
Overview
Looker embedding uses the HTML5 postMessage API to pass messages between the host page and the Looker iframe. This allows for:
- Event Monitoring: Detecting when a dashboard starts/finishes running, when filters change, or when a user navigates.
- Bi-directional Control: Sending commands (actions) from the host app into Looker to trigger runs, update filters, or change layouts.
1. Listening for Events
The host application must listen for message events on the window object.
Implementation Pattern
window.addEventListener("message", function (event) {
// 1. ALWAYS verify the origin for security
if (event.origin !== "https://your_company.looker.com") return;