### dashboard:tile:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Fires when a dashboard tile begins to load or render. It takes the Looker connection and event details as parameters. ```APIDOC ## dashboard:tile:start ### Description Fires when a dashboard tile begins to load or render. ### Method Signature dashboard:tile:start(this: ILookerConnection, event: DashboardTileEvent): void ### Parameters * **this** (ILookerConnection) - The Looker connection instance. * **event** (DashboardTileEvent) - The event object containing details about the tile start. ### Returns void ``` -------------------------------- ### Initialize and Embed Dashboard with Event Handling Source: https://github.com/looker-open-source/embed-sdk/blob/master/README.md Initializes the Embed SDK, embeds a specific dashboard, and sets up event listeners for 'dashboard:run:start' and 'dashboard:run:complete'. It also configures a button to trigger a dashboard run action. ```javascript getEmbedSDK().init('looker.example.com', '/auth') const setupConnection = (connection) => { document.querySelector('#run').addEventListener('click', () => { connection.asDashboardConnection().run() }) } try { connection = await getEmbedSDK() .createDashboardWithId('11') .appendTo('#embed_container') .on('dashboard:run:start', () => updateStatus('Running')) .on('dashboard:run:complete', () => updateStatus('Done')) .build() .connect() setupConnection(connection) } catch (error) { console.error('An unexpected error occurred', error) } ``` -------------------------------- ### Generate RSA Key Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/index.html Use openssl to generate an RSA private key for server authentication. This key is required for the demo server to start. ```bash openssl rsa -in server/keytmp.pem -out server/key.pem ``` -------------------------------- ### explore:run:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Triggered when an explore run starts. This event is part of the Looker Embed SDK's event map. ```APIDOC ## explore:run:start ### Description Triggered when an explore run starts. ### Method Signature `explore:run:start(this: ILookerConnection, event: ExploreEvent): void` ### Parameters * **this** (ILookerConnection) - The Looker connection instance. * **event** (ExploreEvent) - The event object containing details about the explore run start. ``` -------------------------------- ### Example handler for dashboard:tile:merge event Source: https://github.com/looker-open-source/embed-sdk/blob/master/README.md An example handler for the `dashboard:tile:merge` event. This handler checks if the dashboard has been modified and prompts the user for confirmation before proceeding with the merge query edit. It opens a new window with the merge query URL if confirmed. ```javascript const openMergeQuery = ( event: DashboardTileMergeEvent ): CancellableEventResponse => { let doMergeEdit = false if (!event.dashboard_modified) { doMergeEdit = true } else { // Ask the user to confirm they are okay with losing edits doMergeEdit = window.confirm( 'The dashboard has unsaved changes which may be lost if the merge query is edited. Proceed?' ) } if (doMergeEdit) { // The "/merge_edit" route must be implemented by the embedding application. window.open(`/merge_edit?merge_url=${encodeURIComponent(event.url)}`) updateStatus('Merge query edit opened in a new window') } else { updateStatus('Merge query edit cancelled') } return { cancel: true } } ``` -------------------------------- ### ILookerEmbedSDK.createLookWithId() / createLookWithUrl() Source: https://context7.com/looker-open-source/embed-sdk/llms.txt Creates a builder for embedding a saved Looker Look. Supports look:run:start, look:run:complete, look:save:complete, look:delete:complete, look:edit:start, and look:edit:cancel events. ```APIDOC ## ILookerEmbedSDK.createLookWithId() / createLookWithUrl() ### Description Creates a builder for embedding a saved Looker Look. Supports `look:run:start`, `look:run:complete`, `look:save:complete`, `look:delete:complete`, `look:edit:start`, and `look:edit:cancel` events. ### Method ```typescript getEmbedSDK().createLookWithId(id: number) getEmbedSDK().createLookWithUrl(url: string) ``` ### Parameters #### Path Parameters - **id** (number) - Required - The ID of the Look. - **url** (string) - Required - The embed URL for the Look. ### Usage Example ```typescript import { getEmbedSDK } from '@looker/embed-sdk' getEmbedSDK().init('mycompany.looker.com', '/auth') const connection = await getEmbedSDK() .createLookWithId(7) .appendTo('#look-container') .withTheme('Minimal') .on('look:run:start', () => console.log('Running…')) .on('look:run:complete', () => console.log('Done')) .on('look:save:complete', (event) => { console.log('Saved to folder:', event.look.folderId) }) .build() .connect() ``` ``` -------------------------------- ### dashboard:edit:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Fired when the editing of a dashboard has started. Not available for legacy dashboards. Available in Looker 22.20 and later. ```APIDOC ## dashboard:edit:start ### Description Fired when the editing of a dashboard has started. Not available for legacy dashboards. Available in Looker 22.20 and later. ### Method This is an event listener, not a direct method call. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **this**: [ILookerConnection](ILookerConnection.html) * **event**: [DashboardEvent](DashboardEvent.html) ### Response #### Success Response (void) This event does not return a value. #### Response Example None ``` -------------------------------- ### dashboard:run:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Fired when a dashboard run operation begins. This event indicates that the dashboard is starting to load or refresh. ```APIDOC ## dashboard:run:start ### Description Fired when a dashboard run operation begins. ### Method Signature `dashboard:run:start(this: ILookerConnection, event: DashboardEvent): void` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters * **this**: [ILookerConnection](ILookerConnection.html) * **event**: [DashboardEvent](DashboardEvent.html) ### Returns `void` ``` -------------------------------- ### look:run:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Triggered when a look run starts. This event is part of the Looker Embed SDK's event map. ```APIDOC ## look:run:start ### Description Triggered when a look run starts. ### Method Signature `look:run:start(this: ILookerConnection, event: LookEvent): void` ### Parameters * **this** (ILookerConnection) - The Looker connection instance. * **event** (LookEvent) - The event object containing details about the look run start. ``` -------------------------------- ### Create Signed URL for Embed Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/index.html This Javascript example demonstrates a helper method createSignedUrl() for generating a signed URL. It's used in a backend service to handle user authentication for embedding. The secret and user definition are assumed to be available. ```javascript import { createSignedUrl } from './utils/auth_utils'app.get('/looker_auth', function (req, res) { // It is assumed that the request is authorized const src = req.query.src const host = 'looker.example.com' const secret = ... // Embed secret from Looker Server Embed Admin page const user = ... // Embedded user definition const url = createSignedUrl(src, user, host, secret) res.json({ url })} ``` -------------------------------- ### URL Sanitization Example Source: https://github.com/looker-open-source/embed-sdk/blob/master/README.md The Embed SDK sanitizes URLs for cookieless embeds by stripping hostname and protocol, prefixing with `/embed` if missing, and adding `sdk` and `embed_domain` parameters if absent. Invalid URLs will result in an error. ```text /embed/looks/4?embed_domain=https://mywebsite.com becomes /embed/looks/4?embed_domain=https://mywebsite.com&sdk=3 ``` -------------------------------- ### look:edit:start Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Triggered when a look edit starts. This event is available in Looker 25.4+. ```APIDOC ## look:edit:start ### Description Look edit start event. Available in Looker 25.4+. ### Method Signature `look:edit:start(this: ILookerConnection, event: LookEditStartEvent): void` ### Parameters * **this** (ILookerConnection) - The Looker connection instance. * **event** (LookEditStartEvent) - The event object containing details about the look edit start. ``` -------------------------------- ### Demo Server Configuration Source: https://github.com/looker-open-source/embed-sdk/blob/master/README.md Configure the demo server by setting environment variables in a .env file. This file should not be committed to version control. ```shell # Demo Server Configuration # Protocol for the demo server to listen # http or https. Use https if Reports are to be embedded LOOKER_DEMO_PROTOCOL=http # Allow server to be called using a URL other than localhost or 127,0.0.1 # Set to true when developing Embedded Reports LOOKER_DEMO_HOST_EXTERNAL=false # Looker Web Server (omit the protocol) # LOOKER_EMBED_HOST can also be used LOOKER_WEB_URL=mycompany.looker.com # Looker API server (include the protocol) # LOOKER_EMBED_API_URL can also be used LOOKER_API_URL=https://mycompany.looker.com # Host name for the demo server LOOKER_DEMO_HOST=localhost # Port for the demo server LOOKER_DEMO_PORT=8080 # Demo server cookie secret (used to encrypt the cookie) COOKIE_SECRET=cookie_stash # Verify the Looker certificate (for most embed developers, the Looker certificate will be valid) LOOKER_VERIFY_SSL=true # Looker Embed Configuration # Embed type to demo # signed - use signed embedding # cookieless - use cookieless embedding # private - use private embedding LOOKER_EMBED_TYPE=signed # Looker embed secret - from /admin/embed page LOOKER_EMBED_SECRET= # Looker client id - from /admin/users/api3_key/{id} LOOKER_CLIENT_ID= # Looker client secret - from /admin/users/api3_key/{id} LOOKER_CLIENT_SECRET= # Use dynamic embed domains for cookieless embed LOOKER_USE_EMBED_DOMAIN=false # Looker Embed Data Configuration # Set to "-" if demo needs to ignore it # Dashboard IDs LOOKER_DASHBOARD_ID=1 LOOKER_DASHBOARD_ID_2=2 # Look ID LOOKER_LOOK_ID=1 # Explore ID LOOKER_EXPLORE_ID=thelook::orders # Extension ID LOOKER_EXTENSION_ID=extension::my-great-extension # Report ID LOOKER_REPORT_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee # Query Visualization ID LOOKER_QUERY_VISUALIZATION_ID=1234567890ABCDEF123456 ``` -------------------------------- ### createDashboardWithUrl Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/ILookerEmbedSDK.html Create a builder the initially loads a Looker dasboard. ```APIDOC ## createDashboardWithUrl ### Description Create a builder the initially loads a Looker dasboard. ### Method createDashboardWithUrl(url: string) ### Parameters #### Path Parameters * **url** (string) - Required - A signed SSO embed URL or embed URL for an already authenticated Looker user ### Returns [IEmbedBuilder](IEmbedBuilder.html) ``` -------------------------------- ### Configure Demo Server and Embed Settings (.env) Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/index.html Use this template to create a .env file for configuring the demo server and Looker embed settings. Ensure this file is not committed to your git repository. ```env # Demo Server Configuration# Protocol for the demo server to listen# http or https. Use https if Reports are to be embeddedLOOKER_DEMO_PROTOCOL=http# Allow server to be called using a URL other than localhost or 127,0.0.1# Set to true when developing Embedded ReportsLOOKER_DEMO_HOST_EXTERNAL=false# Looker Web Server (omit the protocol)# LOOKER_EMBED_HOST can also be usedLOOKER_WEB_URL=mycompany.looker.com# Looker API server (include the protocol)# LOOKER_EMBED_API_URL can also be usedLOOKER_API_URL=https://mycompany.looker.com# Host name for the demo serverLOOKER_DEMO_HOST=localhost# Port for the demo serverLOOKER_DEMO_PORT=8080# Demo server cookie secret (used to encrypt the cookie)COOKIE_SECRET=cookie_stash# Verify the Looker certificate (for most embed developers, the Looker certificate will be valid)LOOKER_VERIFY_SSL=true# Looker Embed Configuration# Embed type to demo# signed - use signed embedding# cookieless - use cookieless embedding# private - use private embeddingLOOKER_EMBED_TYPE=signed# Looker embed secret - from /admin/embed pageLOOKER_EMBED_SECRET=# Looker client id - from /admin/users/api3_key/{id}LOOKER_CLIENT_ID=# Looker client secret - from /admin/users/api3_key/{id}LOOKER_CLIENT_SECRET=# Use dynamic embed domains for cookieless embedLOOKER_USE_EMBED_DOMAIN=false# Looker Embed Data Configuration# Set to "-" if demo needs to ignore it# Dashboard IDsLOOKER_DASHBOARD_ID=1LOOKER_DASHBOARD_ID_2=2# Look IDLOOKER_LOOK_ID=1# Explore IDLOOKER_EXPLORE_ID=thelook::orders# Extension IDLOOKER_EXTENSION_ID=extension::my-great-extension# Report IDLOOKER_REPORT_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee# Query Visualization IDLOOKER_QUERY_VISUALIZATION_ID=1234567890ABCDEF123456# Theme configuration, Dashboards, Looks and ExploresLOOKER_THEME=DarkLOOKER_CUSTOM_THEME={"show_title":false,"show_filters_bar":false,"text_tile_text_color":"blue"} ``` -------------------------------- ### init Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/classes/LookerEmbedExSDK.html Initializes the Embed SDK with the API host and optional authentication configuration. ```APIDOC ## init ### Description Initialize the Embed SDK. ### Method init(apiHost: string, auth?: string | LookerAuthConfig): void ### Parameters #### Path Parameters * **apiHost** (string) - Required - The API host for Looker. * **auth** (string | LookerAuthConfig) - Optional - Authentication configuration. #### Returns void ``` -------------------------------- ### Initialize Embed SDK and Connect to Dashboard Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/index.html Initializes the Embed SDK with Looker host and auth path, then builds and connects to a specific dashboard. It also sets up event listeners for dashboard run states and a click listener for a 'run' button to trigger a dashboard run. ```javascript getEmbedSDK().init('looker.example.com', '/auth') const setupConnection = (connection) => { document.querySelector('#run').addEventListener('click', () => { connection.asDashboardConnection().run() }) } try { connection = await getEmbedSDK() .createDashboardWithId('11') .appendTo('#embed_container') .on('dashboard:run:start', () => updateStatus('Running')) .on('dashboard:run:complete', () => updateStatus('Done')) .build() .connect() setupConnection(connection) } catch (error) { console.error('An unexpected error occurred', error) } ``` -------------------------------- ### init Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/classes/LookerEmbedSDK.html Initialize the Embed SDK. This method is deprecated and users should use `getEmbedSDK().init(...)` instead. ```APIDOC ## init(apiHost: string, auth?: string | LookerAuthConfig): void ### Description Initialize the Embed SDK. ### Parameters #### Parameters * **apiHost**: string - The address or base URL of the Looker host (example.looker.com:9999, [https://example.looker.com:9999](https://example.looker.com:9999)) This is required for verification of messages sent from the embedded content. * **auth**: string | LookerAuthConfig - Optional authentication configuration. ### Returns void ``` -------------------------------- ### getPageType Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/ILookerConnection.html Get the current page type. ```APIDOC ## getPageType ### Description Get the current page type. ### Method ```javascript getPageType(): PageType ``` ### Returns - PageType: The type of the current page. ``` -------------------------------- ### init Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/ILookerEmbedSDK.html Initializes the Embed SDK with the Looker API host and optional authentication configuration. ```APIDOC ## init ### Description Initialize the Embed SDK. ### Method init(apiHost: string, auth?: string | LookerAuthConfig): void ### Parameters #### Path Parameters - **apiHost** (string) - The address or base URL of the Looker host (example.looker.com:9999, https://example.looker.com:9999). This is required for verification of messages sent from the embedded content. - **auth** (string | LookerAuthConfig) - Optional authentication configuration. ### Returns void ``` -------------------------------- ### run Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedExplore.html Executes the current explore query. ```APIDOC ## run ### Description Run the explore query. ### Method (Implicitly called) ### Endpoint (N/A - SDK method) ### Parameters None ### Request Example ```javascript lookerExplorer.run() ``` ### Response (No specific response documented) ``` -------------------------------- ### init Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/classes/LookerEmbedExSDK.html Initializes the LookerEmbedExSDK. This method must be called before any other SDK methods. ```APIDOC ## init ### Description Initializes the LookerEmbedExSDK. This method must be called before any other SDK methods. ### Method init() ### Returns void ``` -------------------------------- ### ILookerEmbedSDK.createDashboardWithUrl() Source: https://context7.com/looker-open-source/embed-sdk/llms.txt Creates a builder using a signed SSO embed URL or an already-authenticated embed URL (for cookieless or private embed). URL sanitization removes hostname/protocol if present and ensures the /embed prefix. ```APIDOC ## ILookerEmbedSDK.createDashboardWithUrl() ### Description Creates a builder using a signed SSO embed URL or an already-authenticated embed URL (for cookieless or private embed). URL sanitization removes hostname/protocol if present and ensures the `/embed` prefix. ### Method ```typescript getEmbedSDK().createDashboardWithUrl(url: string) ``` ### Parameters #### Path Parameters - **url** (string) - Required - The embed URL for the dashboard. ### Usage Example ```typescript import { getEmbedSDK } from '@looker/embed-sdk' getEmbedSDK().init('mycompany.looker.com', '/auth') const connection = await getEmbedSDK() .createDashboardWithUrl('/embed/dashboards/42?State+%2F+Region=California') .appendTo('#embed-container') .on('dashboard:run:complete', () => console.log('Done')) .build() .connect() ``` ``` -------------------------------- ### LookEditStartEvent Interface Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookEditStartEvent.html This interface defines the structure of the event object for a 'look:edit:start' event. It includes details about the Look being edited. ```APIDOC ## Interface: LookEditStartEvent Look edit start event Looker version 25.4+ ### Hierarchy * [LookerEmbedEvent](LookerEmbedEvent.html) * LookEditStartEvent ### Properties * [look](#look) * [type](#type) ### Property: look `look`: [LookEditEventDetail](LookEditEventDetail.html) Details about the Look being edited. ### Property: type `type`: string Inherited from [LookerEmbedEvent](LookerEmbedEvent.html).[type](LookerEmbedEvent.html#type) The type of the embed event. ``` -------------------------------- ### Configure Embed SDK with Advanced Options Source: https://github.com/looker-open-source/embed-sdk/blob/master/README.md Initialize the Embed SDK with custom headers, parameters, and CORS settings. `withCredentials: true` is necessary for CORS requests to include Http Only cookie headers. ```javascript getEmbedSDK().init('looker.example.com', { url: 'https://api.acme.com/looker/auth', headers: [{ name: 'Foo Header', value: 'Foo' }], params: [{ name: 'foo', value: 'bar' }], withCredentials: true, // Needed for CORS requests to Auth endpoint include Http Only cookie headers }) ``` -------------------------------- ### Get the singleton SDK instance Source: https://context7.com/looker-open-source/embed-sdk/llms.txt Always call `getEmbedSDK()` before using any other SDK feature. You can optionally inject a custom instance for testing or re-initialization. ```typescript import { getEmbedSDK } from '@looker/embed-sdk' // Get the default singleton const sdk = getEmbedSDK() // Inject a custom instance (e.g. to force a new session) import { LookerEmbedExSDK, getEmbedSDK } from '@looker/embed-sdk' const freshSdk = getEmbedSDK(new LookerEmbedExSDK()) ``` -------------------------------- ### dashboard:save:complete Source: https://github.com/looker-open-source/embed-sdk/blob/master/docs/interfaces/LookerEmbedEventMap.html Fired when a dashboard being edited is saved. Use in conjunction with `dashboard:edit:start` and `dashboard:edit:save`. Looker 21.6+. ```APIDOC ## dashboard:save:complete ### Description Dashboard saved event. Fired when a dashboard being edited is saved. Use in conjunction with `dashboard:edit:start` and `dashboard:edit:save`. Looker 21.6+. ### Method Signature `dashboard:save:complete(this: ILookerConnection, event: DashboardEvent): void` ### Parameters #### Path Parameters * None #### Query Parameters * None #### Request Body * None ### Parameters * **this**: [ILookerConnection](ILookerConnection.html) * **event**: [DashboardEvent](DashboardEvent.html) ### Returns `void` ``` -------------------------------- ### IEmbedBuilder.build() / IEmbedClient.connect() Source: https://context7.com/looker-open-source/embed-sdk/llms.txt Finalizes the embed builder and connects to the Looker iframe. `build()` locks the builder and returns an `IEmbedClient`. `connect()` creates the `