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

@meltingspot/embed

v1.0.0

Published

MeltingSpot Embed SDK

Downloads

300

Readme

Embed SDK

Embed a full MeltingSpot spot into your own web application through an iframe, with lifecycle callbacks and theming.

Installation

Via <script> (CDN)

The standalone bundle is self-contained: it exposes window.MeltingSpot.Embed.

<script
  crossorigin
  src="https://cdn.jsdelivr.net/npm/@meltingspot/embed"
></script>

Via npm

npm install @meltingspot/embed
import { Embed } from '@meltingspot/embed';

Usage

Add a container element and inject your spot into it:

<div id="meltingspot-frame" style="width: 100%; height: 100%"></div>
<script>
  window.addEventListener('DOMContentLoaded', function () {
    window.MeltingSpot.Embed.injectSpotInto('meltingspot-frame', {
      spotId: 'YOUR_SPOT_ID',
      authToken: 'CURRENT_USER_SSO_TOKEN',
      themeMode: 'auto',
    });
  });
</script>

The programmatic equivalent:

import { Embed } from '@meltingspot/embed';

Embed.injectSpotInto('meltingspot-frame', {
  spotId: 'YOUR_SPOT_ID',
  authToken: 'CURRENT_USER_SSO_TOKEN',
  themeMode: 'auto',
});

Authentication (authToken)

authToken is the MeltingSpot SSO token of the current user. Provide it to embed the spot as an authenticated member, so the user sees the same content and permissions as inside MeltingSpot. Activate SSO on your spot to obtain these tokens.

Omit authToken to embed in public mode: only publicly available content is shown and the visitor is treated as anonymous.

injectSpotInto(target, options)

target (required) is the container: an element id (string) or an HTMLElement.

| Option | Type | Required | Default | Description | | --------------- | ----------------------------------------- | -------- | --------------------------------------------- | --------------------------------------------------------- | | spotId | string | Yes | n/a | Target spot id. Required here unless set via the config. | | authToken | string | No | ms_token URL param, else none (public mode) | Current user's MeltingSpot SSO token. | | themeMode | 'auto' \| 'system' \| 'light' \| 'dark' | No | 'auto' | Force a theme. | | deeplink | string | No | ms_url URL param, else none | In-spot page opened on load. See deeplink. | | domain | string | No | none (default MeltingSpot domain) | Custom domain key of your spot. See domain. | | utmParameters | UtmParameters | No | parsed from the page URL params | UTM params appended to the embed URL. | | rootDocument | Document | No | current document | Document to inject into. | | onReady | () => void | No | none | Called when the embedded content is fully rendered. | | onError | (error) => void | No | none | Called on a loading error inside the iframe. |

deeplink

The in-spot page the embed opens on load (a path or URL, e.g. a channel, course or post). It is normalized to the spot route (/spot/{spotId}/...), preserving the query string and hash.

If omitted, the SDK auto-detects a deeplink from the ms_url query param that MeltingSpot injects into the links generated by the app (e.g. links sent in emails). Setting deeplink explicitly disables that automatic detection and forces your value instead.

See the embed guide for details.

domain

The custom domain key of your spot. It is forwarded to the embedded content so the links it generates point to your custom domain instead of the default MeltingSpot one.

See the "Multi-domains" section of the embed guide for details.

UtmParameters

Appended to the embed URL as utm_* query params (source becomes utm_source, etc.).

| Field | Type | Required | Default | Description | | ---------- | -------- | -------- | ------- | --------------------- | | source | string | Yes | n/a | utm_source value. | | medium | string | No | unset | utm_medium value. | | campaign | string | No | unset | utm_campaign value. | | term | string | No | unset | utm_term value. | | content | string | No | unset | utm_content value. |

Lifecycle callbacks

onReady / onError are backed by postMessage signals (meltingspot:ready / meltingspot:error) with origin validation.

Embed.injectSpotInto('meltingspot-frame', {
  spotId: 'YOUR_SPOT_ID',
  authToken: 'CURRENT_USER_SSO_TOKEN',
  themeMode: 'auto',
  onReady: () => console.info('MeltingSpot embed is ready'),
  onError: (error) => console.error('MeltingSpot embed error:', error.message),
});

The error object passed to onError:

| Property | Type | Description | | --------- | -------- | --------------------------------- | | type | string | Optional error type | | message | string | Human-readable error message | | code | string | Optional error code for debugging |

See the Embed helpdesk for the full integration guide.