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

mirrortour-ai

v1.0.7

Published

AI-powered website tour guide using Mirror AI

Downloads

534

Readme

MirrorTour AI SDK

AI-powered website tour guide using Mirror AI. Features voice input, conversation history, offline mode, and custom branding.

Installation

NPM

npm install mirrortour-ai

CDN (jsDelivr - Free)

<!-- Latest version -->
<script src="https://cdn.jsdelivr.net/npm/mirrortour-ai/dist/mirrortour-ai.iife.js" 
        data-mirror-key="YOUR_MIRROR_KEY">
</script>

<!-- Or specific version -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/mirrortour-ai.iife.js" 
        data-mirror-key="YOUR_MIRROR_KEY">
</script>

unpkg (Alternative CDN)

<script src="https://unpkg.com/mirrortour-ai/dist/mirrortour-ai.iife.js" 
        data-mirror-key="YOUR_MIRROR_KEY">
</script>

Usage

ES Module

import { MirrorTourAI } from 'mirrortour-ai';

MirrorTourAI.init({
  mirrorKey: 'YOUR_MIRROR_KEY',
  position: 'bottom-right',
  theme: 'dark',
  // Custom branding
  title: 'My Assistant',
  primaryColor: '#6366f1',
  secondaryColor: '#14b8a6'
});

Script Tag (Auto-init)

<script src="mirrortour-ai.iife.js" 
        data-mirror-key="YOUR_MIRROR_KEY"
        data-position="bottom-right"
        data-theme="dark">
</script>

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | mirrorKey | string | required | Your Mirror AI API key | | apiUrl | string | auto-detect | Backend API URL | | position | string | 'bottom-right' | Orb position (bottom-right, bottom-left) | | theme | string | 'dark' | UI theme (dark, light) | | autoGreet | boolean | true | Auto-greet on first open | | voice | string | 'af_heart' | Kokoro TTS voice ID |

Branding Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | title | string | 'MirrorTour' | Assistant name in header | | primaryColor | string | '#6366f1' | Primary color (Tour mode) | | secondaryColor | string | '#14b8a6' | Secondary color (Chat mode) | | logo | string | null | Custom logo URL | | greeting | string | null | Custom greeting message |

Features

🎤 Voice Input

Click the mic button to speak. Uses Web Speech API.

💬 Conversation History

Messages are saved to localStorage and persist across sessions.

📴 Offline Mode

Messages sent while offline are queued and automatically sent when back online.

📝 Markdown Support

Assistant responses support bold, italic, code, and links.

⏰ Timestamps

Messages show relative timestamps ("Just now", "5m ago", etc.)

🎨 Custom Branding

Fully customizable colors and title to match your brand.

API

// Get instance
const tour = MirrorTourAI.getInstance();

// Open/close modal
tour.open();
tour.close();

// Send message programmatically
tour.sendMessage('Show me pricing');

// Destroy instance
MirrorTourAI.destroy();

DOM Actions

The AI can perform these actions on your page:

| Action | Description | |--------|-------------| | scrollTo | Scroll to an element | | highlight | Highlight an element with pulse effect | | click | Click a button or link | | fillInput | Fill form fields | | navigate | Navigate to a URL (same page) | | openLink | Open external link in new tab |

Backend Setup

The SDK requires a backend server running the MirrorTour API. See the main repository for setup instructions.

Building

cd sdk
npm install
npm run build

Outputs:

  • dist/mirrortour-ai.es.js - ES Module
  • dist/mirrortour-ai.umd.js - UMD
  • dist/mirrortour-ai.iife.js - Script tag

Publishing to NPM

npm login
npm publish

License

MIT

Website Integration Guide

Mirror Tour AI works by analyzing your website's DOM structure. Follow these guidelines for the best experience.

1. Semantic HTML Structure

  • Headings: Use <h1> for main titles, <h2> for section titles.
  • Navigation: Use <nav> for menus.
  • Sections: Use <section> or <article> to group content.

2. Interactive Elements MUST Have IDs

For the AI to click buttons, fill inputs, or scroll to specific areas, elements must have unique IDs.

<!-- BAD -->
<button class="signup-btn">Sign Up</button>

<!-- GOOD -->
<button id="signup-btn">Sign Up</button>
<section id="pricing">...</section>

Why? The AI generates a "Page Context" that lists interactive elements by their ID (#signup-btn). If an ID is missing, the AI cannot interact with it.

3. Clear Text Content

  • Avoid breaking text into many small <span> tags.
  • Ensure visible text is actual text in the DOM, not images.

4. Testing Compatibility

Run this in your browser console:

document.querySelectorAll('*[id]').length

If the number is low (< 5), add more IDs to important elements (Nav links, CTA buttons, Form inputs).