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

flam-interactive-ads

v0.0.1-beta.11

Published

Framework-agnostic Flam Ads SDK — drop a single script tag or import to embed interactive video ads

Downloads

125

Readme

flam-interactive-ads

Embed interactive Flam video ads in plain HTML or React.

Installation

npm install flam-interactive-ads

Plain HTML

Drop a script tag and use the <flam-ad> custom element. No JavaScript needed.

<script src="https://unpkg.com/flam-interactive-ads/dist/ads.js" defer></script>

<flam-ad></flam-ad>

Default behaviour (no attributes):

  • The element expands to fill its parent (width: 100%; height: 100% via the SDK stylesheet).
  • The ad auto-sizes from the video's native dimensions, scaled down to fit within the parent while preserving aspect ratio.
  • object-fit defaults to "contain" — the ad is letterboxed inside the parent; no cropping.

All attributes are optional:

<!-- fixed size, custom class, cover fit -->
<flam-ad width="400" height="300" classname="my-ad" object-fit="cover"></flam-ad>

Attributes

| Attribute | Type | Default | Description | |---|---|---|---| | width | number | — | Display width in px. Sets style.width on the element. Omit to fill the parent width. | | height | number | — | Display height in px. Sets style.height on the element. Omit to fill the parent height. | | classname | string | — | One or more space-separated CSS classes added to the element. | | object-fit | "contain" \| "cover" | "contain" | contain fits the ad inside the container (letterboxed). cover scales the ad to fill the container completely, clipping any overflow. |

class (the standard HTML attribute) is also supported and applied natively by the browser.


React

Initialize the SDK once at your app entry, then drop <FlamAdSlot> anywhere.

// main.tsx
import { FlamAds } from 'flam-interactive-ads';
FlamAds.init();
import { FlamAdSlot } from 'flam-interactive-ads/react';

function AdBanner() {
  return (
    <FlamAdSlot
      width={400}
      height={300}
      objectFit="cover"
      onReady={({ slotId }) => console.log('ready', slotId)}
      onClick={({ url }) => console.log('clicked', url)}
      onError={({ message }) => console.error(message)}
    />
  );
}

Default behaviour (no props):

  • The host <div> expands to fill its parent (width: 100%; height: 100%).
  • The ad auto-sizes from the video's native dimensions, scaled down to fit within the parent.
  • objectFit defaults to "contain" — letterboxed inside the container, no cropping.

Props

| Prop | Type | Default | Description | |---|---|---|---| | width | number | — | Display width in px. Omit to auto-size from the parent width. | | height | number | — | Display height in px. Omit to auto-size from the parent height. | | objectFit | "contain" \| "cover" | "contain" | contain fits the ad inside the container (letterboxed). cover scales the ad to fill the container completely, clipping any overflow. | | onReady | ({ slotId }) => void | — | Fires when the ad is visible and ready. | | onClick | ({ slotId, markerId, url }) => void | — | Fires when a clickable marker is clicked. | | onMarkerChange | ({ slotId, markerId }) => void | — | Fires when the active marker changes. | | onError | ({ slotId, message }) => void | — | Fires on initialization or playback error. | | onMute | ({ slotId, muted }) => void | — | Fires when the user toggles mute. | | className | string | — | CSS class on the host <div>. | | style | CSSProperties | — | Inline styles on the host <div>. |


Programmatic API

For full control outside of React:

import { FlamAds } from 'flam-interactive-ads';

const sdk = FlamAds.init();
const slot = sdk.createSlot({
  container: document.getElementById('ad')!,
  width: 400,
  height: 300,
  objectFit: 'cover',   // optional, defaults to 'contain'
});

slot
  .on('ready', ({ slotId }) => console.log('ready', slotId))
  .on('click', ({ url }) => console.log('clicked', url))
  .on('error', ({ message }) => console.error(message));

// Later — mute or clean up
slot.mute(true);
slot.destroy();