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

@epilot/journey-embed-sdk

v0.3.0

Published

Fluent builder SDK for embedding epilot Journeys on external websites — supports <iframe> and <epilot-journey> web component backends.

Readme

@epilot/journey-embed-sdk

Fluent builder SDK for embedding epilot Journeys on external websites. Supports two rendering backends behind a single chainable API:

  • <iframe> — stronger style isolation, multiple Journeys per page.
  • <epilot-journey> web component — renders in Shadow DOM, better performance and accessibility.

Install

npm install @epilot/journey-embed-sdk
# or
yarn add @epilot/journey-embed-sdk
# or
pnpm add @epilot/journey-embed-sdk

Usage

Bundler (ESM / CJS)

import { Epilot } from '@epilot/journey-embed-sdk'

const $epilot = new Epilot()

$epilot
  .embed('<your-journey-id>')
  .asWebComponent()
  .mode('inline')
  .append('#embed-target')

React (with refs)

Placement methods (append, prepend, before, after) accept either a CSS selector or a direct HTMLElement. That means you can pass ref.current without having to give your target an id or class.

import { useEffect, useRef } from 'react'
import { Epilot, type Embedding } from '@epilot/journey-embed-sdk'

const $epilot = new Epilot()

export function JourneyEmbed({ journeyId }: { journeyId: string }) {
  const targetRef = useRef<HTMLDivElement | null>(null)
  const embeddingRef = useRef<Embedding | null>(null)

  useEffect(() => {
    if (!targetRef.current) return

    embeddingRef.current = $epilot
      .embed(journeyId)
      .asWebComponent()
      .mode('inline')
      .append(targetRef.current)

    return () => {
      embeddingRef.current?.remove()
      embeddingRef.current = null
    }
  }, [journeyId])

  return <div ref={targetRef} />
}

The .remove() call in the cleanup detaches the element and tears down all SDK listeners, so the component is safe to mount, unmount, and remount without leaks.

Browser via CDN

Synchronous:

<script src="https://embed.journey.epilot.io/sdk/bundle.js"></script>
<script>
  $epilot.embed('<your-journey-id>').asWebComponent().append('#embed-target')
</script>

Asynchronous — use the onReady queue so your page can load the SDK without blocking:

<head>
  <script>
    ;(function (h, o, u, n, d) {
      h = h[d] = h[d] || {
        q: [],
        onReady: function (c) {
          h.q.push(c)
        }
      }
      d = o.createElement(u)
      d.async = 1
      d.src = n
      n = o.getElementsByTagName(u)[0]
      n.parentNode.insertBefore(d, n)
    })(
      window,
      document,
      'script',
      'https://embed.journey.epilot.io/sdk/bundle.js',
      '$epilot'
    )
  </script>
</head>
<body>
  <!-- rest of your page -->
  <script>
    window.$epilot.onReady(function (epilot) {
      epilot.embed('<your-journey-id>').asWebComponent().append('#embed-target')
    })
  </script>
</body>

API

See the full documentation at docs.epilot.io/docs/journeys/sdk.

Quick reference

| Method | Purpose | | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | .asIframe() / .asWebComponent() | Pick the backend. | | .mode('inline' \| 'full-screen') | Display mode. Defaults to inline. | | .topBar(bool) | Show/hide the Journey top bar. | | .scrollToTop(bool) | Scroll to top on step navigation. | | .closeButton(bool) | Show/hide the close button. | | .contextData({...}) | Key/value data forwarded to the Journey. Accepts string or number values (numbers are coerced to strings). | | .dataInjectionOptions({...}) | Pre-fill fields and/or set the starting step. | | .name(string) | Accessible name for the embedded element. | | .testId(string) | Sets data-testid on the element for tests. | | .id(string) | Sets id on the element. Call before placement. | | .isFullScreenEntered(bool) | Enter/exit full-screen programmatically. | | .append / .prepend / .before / .after | DOM placement — end of the chain. | | .el() | Returns the injected element. | | .remove() | Remove the element and tear down listeners. |

Configuration

new Epilot(options?) accepts:

| Option | Type | Default | Purpose | | ----------------------- | --------- | ----------------------------- | ----------------------------------------------------------------------------- | | baseUrl | string | 'https://journey.epilot.io' | Base URL of the Journey app. | | webComponentScriptUrl | string | — | Explicit override for the <epilot-journey> script URL. Useful in local dev. | | debug | boolean | false | Enable iframe-resizer verbose logging. |

License

MIT © epilot GmbH