@kozmoai/backstage-plugin-iframe
TypeScript icon, indicating that this package has built-in type declarations

1.3.16 • Public • Published

Iframe plugin

Features

  • Displays a simple iframe from a url

Plugin Setup

  1. If you have standalone app (you didn't clone this repo), then in the packages/app directory of your backstage instance, add the plugin as a package.json dependency:
yarn add @kozmoai/backstage-plugin-iframe
  1. Import the plugin to the entityPage.tsx source file:
// packages/app/src/components/catalog/EntityPage.tsx
import {
  iframePlugin,
  EntityIFrameCard,
  EntityIFrameContent,
} from '@kozmoai/backstage-plugin-iframe';
...

const contentProps = {
  frames: [
    {
      src: "https://example.com"
    }
  ],
  title: "super cool title"
}

const serviceEntityPage = (
  <EntityLayoutWrapper>
    ...
    <EntityLayout.Route
      path="/mycustom-iframes"
      title="Iframes">
        <EntityIFrameContent {...iframeProps} />
    </EntityLayout.Route>
    ...
  </EntityLayoutWrapper>
);

const iframeProps = {
  src: "https://example.com"
}

const overviewContent = (
  <Grid container spacing={3}>
    ...
    <Grid item md={8}>
      <EntityIFrameCard {...iframeProps}/>
    </Grid>
    ...
  </Grid>
);
// packages/app/src/components/home/HomePage.tsx
import { HomePageIFrameCard } from '@kozmoai/backstage-plugin-iframe';

export const HomePage = () => {
  return (
    ...
    <Grid item xs={12} md={6}>
        <HomePageIFrameCard
          title="Super cool title"
          src="https://example.com"
        />
      </Grid>
    ...
  );
};

Allowlisting

This particular plugin supports allowlisting. What this means is you can add a domain to the plugin's configuration that will be verified during the creation of the plugins components.

The config is like so:

// app-config.yaml
iframe:
  allowList: ["some-domain.com"]

Links

Readme

Keywords

none

Package Sidebar

Install

npm i @kozmoai/backstage-plugin-iframe

Weekly Downloads

4

Version

1.3.16

License

Apache-2.0

Unpacked Size

44.9 kB

Total Files

16

Last publish

Collaborators

  • mohamedbench