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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@intheroomglobal/speakeasy-embed

v0.4.3

Published

In The Room speakeasy embed

Downloads

46

Readme

Speakeasy Embed

Library to embed Speakeasy experiences within a website.

Installation

You can install using your favourite package manager, or import from jsdelivr directly into your webpage.

Using npm (or yarn, or pnpm)

npm install @intheroomglobal/speakeasy-embed

HTML

<script type="module">
  import SpeakeasyEmbed from "https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js";

  SpeakeasyEmbed.embed({
    id: "<YOUR EXPERIENCE ID>"
  });

  // ...

  SpeakeasyEmbed.destroyAll();
</script>

Usage

The embed can either be called programmatically, or auto-initialised via a script tag for users who do not wish to set anything up themselves. Embeds can be instantiated with const embed = new SpeakeasyEmbed(...) and destroyed with embed.destroy() if you want to keep track of the instance yourself, or instantiated via factory method SpeakeasyEmbed.embed(...) and destroyed via SpeakeasyEmbed.destroyAll() if you don't need fine grained control. Options passed remain consistent between both methods.

Styles are automatically injected when using script embeds. In JavaScript, you can import '@intheroomglobal/speakeasy-embed/dist/es/embed.css'; and have your bundler take care of the CSS (or create a <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/es/embed.css" /> manually).

Passing a version date string will ensure you are using the latest version of the Speakeasy API. The easiest way is to pass the current date of use, in yyyy-mm-dd format. The earliest supported version is 2024-01-01.

Bubble

A chat-bubble style experience. Opens on click, and maximises once interacted with.

JS

import SpeakeasyEmbed from "@intheroomglobal/speakeasy-embed";

new SpeakeasyEmbed({
  id: "<YOUR EXPERIENCE ID>",
  version: "2024-01-01"
});

Script embed

<script
  src="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js"
  id="<YOUR EXPERIENCE ID>"
  data-version="2024-01-01"
></script>

Inline

An inline experience that shows in an element on the page in the regular flow. Maximises once interacted with.

JS

import SpeakeasyEmbed from "@intheroomglobal/speakeasy-embed";

new SpeakeasyEmbed({
  id: "<YOUR EXPERIENCE ID>",
  parent: ".some-selector", // Either selector or DOM element
  version: "2024-01-01"
});

Script embed

<script
  src="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js"
  id="<YOUR EXPERIENCE ID>"
  data-parent=".some-selector"
  data-version="2024-01-01"
></script>

Fullscreen

A fullscreen experience. Cannot be minimised, so should live on it's own page.

JS

import SpeakeasyEmbed from "@intheroomglobal/speakeasy-embed";

new SpeakeasyEmbed({
  id: "<YOUR EXPERIENCE ID>",
  fullscreen: true,
  version: "2024-01-01"
});

Script embed

<script
  src="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js"
  id="<YOUR EXPERIENCE ID>"
  data-fullscreen
  data-version="2024-01-01"
></script>

Additional options

Aspect Ratio

To change the aspect ratio of the embed

JS

new SpeakeasyEmbed({
  id: "<YOUR EXPERIENCE ID>",
  aspectRatio: "16:9",
  version: "2024-01-01"
});

Script embed

<script
  src="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js"
  id="<YOUR EXPERIENCE ID>"
  data-aspect-ratio="16:9"
  data-version="2024-01-01"
></script>

Inline experiences

To prevent experiences maximising when interacted with. Ignored by fullscreen embeds.

JS

new SpeakeasyEmbed({
  id: "<YOUR EXPERIENCE ID>",
  inline: true,
  version: "2024-01-01"
});

Script embed

<script
  src="https://cdn.jsdelivr.net/npm/@intheroomglobal/speakeasy-embed/dist/browser/embed.js"
  id="<YOUR EXPERIENCE ID>"
  data-inline
  data-version="2024-01-01"
></script>

Styling issues

The embeds are built in such a way as to work with most websites out of the box. If you have CSS issues (usually layer based problems with drag and drop editors such as Wix, Squarespace, etc), you can add a style tag to target the conversation to fix the issue.

<style>
  .speakeasy-embed__iframe {
    z-index: 101;
  }