npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cesarechazu/directus-extension-dynamic-iframe

v1.0.1

Published

Embed secure pages using a URL template resolved from the current form values.

Readme

Dynamic iFrame

Embed a secure external page inside a Directus alias field using a URL template.

This interface is useful for showing dashboards, previews, reports, or external tools directly inside the item editor, based on the current form values.

This pattern is especially useful for embedded analytics and reporting dashboards, where the URL needs to change according to the record currently being edited.

Interface

Features

  • Renders an external page inside an iframe
  • Resolves placeholders from the current form values
  • Updates the iframe URL when referenced form values change
  • Supports configurable debounce before reloading
  • Optional loading indicator
  • Optional open in new tab shortcut
  • Optional fullscreen permission
  • Supports custom height
  • Supports custom border styling
  • Supports custom border radius
  • Accepts only https URLs
  • Shows a placeholder when the URL is missing or invalid
  • Works as an alias field, so it does not create a database column

Options

  • url_template: target page template, for example https://example.com?client={{client_id}}
  • height: iframe height, for example 800px (default 800px)
  • debounce: delay in milliseconds before updating the iframe URL, default 250
  • loading: show a visual loading indicator while the iframe reloads, default true
  • border: any valid CSS border value
  • border_radius: any valid CSS border radius value
  • open_in_new_tab: show a shortcut to open the resolved URL in a new tab, default false
  • allow_fullscreen: enables fullscreen support on the iframe, default false

Dynamic Placeholders

The url_template can use values from other fields in the current item form.

Examples:

  • https://example.com/dashboard?client={{client_id}}
  • https://example.com/report/{{id}}
  • https://example.com/embed?customer={{customer.id}}
  • https://example.com/embed?customer={{customer.id}}&name={{customer.name}}

Supported placeholder formats:

  • {{field_name}}: reads a top-level field from the current form
  • {{relation.id}}: reads nested values using dot notation
  • {{id}}: resolves the current item primary key

Usage Example

One practical use case is a singleton collection used as a control panel or embedded reporting view.

Example setup:

  • Create a singleton collection
  • Add a many-to-one field such as customer_id related to a customers collection
  • Add a second field using the Dynamic iFrame interface as an alias field
  • Configure the iframe url_template like:
    • https://example.com/dashboard?customer={{customer_id}}

Behavior:

  • When the user changes the selected customer in the customer_id field
  • Directus updates the form state immediately
  • The iframe resolves the new {{customer_id}} value
  • The iframe reloads automatically after the configured debounce

This makes it useful for filtered dashboards, contextual previews, embedded reports, or any external page that needs to react to other field values in the current form.

Notes

  • This interface only renders secure (https) pages.
  • Some websites block embedding with X-Frame-Options or Content-Security-Policy.
  • This interface works best with pages that are designed to be embedded.