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

@bookinghub/widget

v0.12.3

Published

Embeddable booking widget for BookingHub merchants

Readme

@bookinghub/widget

Embeddable booking widget for BookingHub merchants. Drop a single <script> tag on any website and your customers can book services directly.

  • Zero dependencies at runtime
  • Shadow DOM isolation — works on any website without CSS conflicts
  • 33 KB gzipped

Quick Start

Add this snippet before </body> on your website:

<script
  src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js"
  data-slug="YourOrgSlug"
></script>

That's it. A floating "Book Now" button appears in the bottom-right corner.

Script Attributes

| Attribute | Required | Default | Description | |-----------|----------|---------|-------------| | data-slug | Yes | — | Your organization slug (from BookingHub dashboard) | | data-locale | No | ka | Locale for the widget UI |

Installation Methods

CDN (recommended for most websites)

<!-- Latest version -->
<script src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js" data-slug="YourOrgSlug"></script>

<!-- Pinned version -->
<script src="https://cdn.bookinghub.ge/v1/bookinghub-widget.iife.js" data-slug="YourOrgSlug"></script>

Works with async and defer:

<script async src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js" data-slug="YourOrgSlug"></script>

npm

npm install @bookinghub/widget
import { init } from '@bookinghub/widget'

init({
  slug: 'YourOrgSlug',
})

JavaScript API

When loaded via CDN, the widget is available as BookingHubWidget on the global scope:

<script src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js"></script>
<script>
  BookingHubWidget.init({
    slug: 'YourOrgSlug',
    locale: 'ka', // optional
    target: document.getElementById('my-container'), // optional, defaults to document.body
  })
</script>

Platform Examples

WordPress

Add to your theme's footer.php before </body>, or use a plugin like "Insert Headers and Footers":

<script src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js" data-slug="YourOrgSlug"></script>

Wix

  1. Go to Settings > Custom Code
  2. Add new code snippet, paste the <script> tag
  3. Set placement to "Body - end"

Squarespace

  1. Go to Settings > Advanced > Code Injection
  2. Paste the <script> tag in the "Footer" section

Shopify

  1. Go to Online Store > Themes > Edit Code
  2. Open theme.liquid
  3. Paste the <script> tag before </body>

Webflow

  1. Go to Project Settings > Custom Code
  2. Paste the <script> tag in the "Footer Code" section

Next.js

// app/layout.tsx
import Script from 'next/script'

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Script
          src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js"
          data-slug="YourOrgSlug"
          strategy="lazyOnload"
        />
      </body>
    </html>
  )
}

Nuxt

<!-- app.vue -->
<template>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>

<script setup>
useHead({
  script: [
    {
      src: 'https://cdn.bookinghub.ge/bookinghub-widget.iife.js',
      'data-slug': 'YourOrgSlug',
      defer: true,
    },
  ],
})
</script>

Static HTML / Any Website

<!DOCTYPE html>
<html>
  <head>
    <title>My Business</title>
  </head>
  <body>
    <!-- your page content -->

    <script src="https://cdn.bookinghub.ge/bookinghub-widget.iife.js" data-slug="YourOrgSlug"></script>
  </body>
</html>

How It Works

  1. The script creates an isolated Shadow DOM container on the page
  2. A floating button appears in the bottom-right corner
  3. Clicking it opens a side panel with:
    • Service selection (browse by category)
    • Specialist and time slot picker
    • Payment summary
    • Login/registration (phone + SMS verification)
  4. On confirmation, the booking is created via the BookingHub API

Browser Support

All modern browsers (Chrome 53+, Firefox 63+, Safari 10+, Edge 79+).

Development

pnpm install        # install dependencies
pnpm dev            # dev server with HMR
pnpm build          # production build → dist/
pnpm check          # type-check
pnpm preview        # preview production build
  • index.html — dev preview (source-driven, used by pnpm dev)
  • test.html — embed test (loads built dist/ bundle, simulates real embed)