Embed

The Quilt catalog has limited-feature S3 browser called Embed, an embeddable iframe. Embed is served off the main catalog under /__embed route.

Usage

Here's a sample code snippet in plain JavaScript + React that outlines the basic use cases:

API reference

URL and query parameters

The Embed is served off the main catalog server under /__embed route which takes two optional query parameters:

nonce (any unique string) is used to identify "our" Embed instance and make sure we're receiving messages from that same instance.

origin must be sent to enable cross-origin message passing from Embed to the parent.

Commands to Embed

Embed accepts commands from the parent via postMessage API. Command message data format:

Available commands are listed below.

init

Initialize the Embed. This command must be sent after the Embed is ready (see ready message reference for details). Supported SSO providers are listed in the Technical Reference.

navigate

Navigate to the given route.

Messages from Embed

Embed sends messages to its parent via postMessage API. Message data format:

Available messages are listed below.

ready

Sent when the Embed is done loading and ready to receive commands (waiting for init command).

error

Sent when an error occurs.

navigate

Sent when the Embed navigates to a new route. Useful for syncing Embed state with the parent app state.

s3ObjectLink

Enabled only when overrides.s3ObjectLink.emit parameter is set during initialization. Sent when the link button in the object version menu is clicked.

Testing and debugging

The catalog's /__embed-debug route is a simple driver for testing Embed:

__embed-debug is useful for trying different parameters and inspecting messages passed to and from the Embed.

Its main components are:

  1. Inputs for init parameters and button for sending the init command.

  2. "Navigate to" button and route input for sending the navigate command.

  3. Embed window.

  4. Message log.

Last updated

Was this helpful?