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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@askbenny/convai-widget-core

v1.2.5

Published

The common library for the Conversational AI Widget Wrapper for elevenlabs

Downloads

54

Readme

ConvAI Widget Core

A conversational AI widget wrapper for ElevenLabs, built with Preact and TypeScript. This library provides a customizable web component for integrating conversational AI into web applications.

Features

  • 🎙️ Voice-enabled conversational AI widget
  • 🎨 Customizable UI with Tailwind CSS
  • 📱 Responsive design with multiple trigger styles
  • 🌐 Multi-language support
  • 🔧 Web Component architecture for easy integration
  • ⚡ Built with Preact for optimal performance
  • 🎯 TypeScript support with full type definitions

Installation

npm install @askbenny/convai-widget-core

Quick Start

As a Web Component

<!DOCTYPE html>
<html>
<head>
  <title>ConvAI Widget Demo</title>
</head>
<body>
  <script type="module">
    import { registerWidget } from '@askbenny/convai-widget-core';
    
    // Register the web component
    registerWidget();
    
    // Create and configure the widget
    const widget = document.createElement('askbenny-convai');
    widget.setAttribute('agent-id', 'your-agent-id');
    document.body.appendChild(widget);
  </script>
</body>
</html>

Custom Tag Name

import { registerWidget } from '@askbenny/convai-widget-core';

// Register with a custom tag name
registerWidget('my-convai-widget');

Configuration

The widget accepts various attributes for customization:

<askbenny-convai
  agent-id="your-agent-id"
  server-location="us"
  language="en"
  trigger-style="compact"
></askbenny-convai>

Development

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm

Setup

# Clone the repository
git clone https://github.com/askbenny/convai-widget-core.git
cd widget-v2

# Install dependencies
pnpm install

# Start development server
pnpm dev

Scripts

  • pnpm dev - Start development server
  • pnpm build - Build for production
  • pnpm test - Run tests with Vitest
  • pnpm lint - Run all linting checks
  • pnpm lint:ts - TypeScript type checking
  • pnpm lint:es - ESLint checking
  • pnpm lint:prettier - Prettier formatting check

Testing

The project uses Vitest with Playwright for browser testing:

pnpm test

Tests run in a real browser environment with microphone permissions for comprehensive testing of voice features.

Project Structure

src/
├── components/          # Reusable UI components
├── contexts/           # React/Preact contexts for state management
├── orb/               # 3D orb visualization
├── styles/            # CSS and styling
├── types/             # TypeScript type definitions
├── utils/             # Utility functions and hooks
├── widget/            # Main widget components
├── index.ts           # Main entry point
└── index.dev.tsx      # Development entry point

Architecture

  • Preact: Lightweight React alternative for optimal bundle size
  • Web Components: Shadow DOM encapsulation for style isolation
  • TypeScript: Full type safety and developer experience
  • Tailwind CSS: Utility-first CSS framework
  • Vite: Fast build tool and development server
  • Vitest: Fast unit and browser testing

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-feature
  3. Make your changes and add tests
  4. Run linting: pnpm lint
  5. Run tests: pnpm test
  6. Commit your changes: git commit -m 'Add new feature'
  7. Push to the branch: git push origin feature/new-feature
  8. Submit a pull request

CI/CD

Automated NPM Releases

This project is configured to automatically publish to npm when code is merged to the main branch.

GitHub Secrets Configuration

The automated release workflow requires the following GitHub secrets:

1. NPM_TOKEN (Required)

Used for publishing packages to npm registry.

Setup Instructions:

  1. Generate an npm access token:

    • Log in to npmjs.com
    • Go to your account settings → Access Tokens
    • Click "Generate New Token"
    • Choose "Classic Token" with "Automation" type
    • Copy the generated token
  2. Add the token to GitHub:

    • Go to your repository on GitHub
    • Navigate to Settings → Secrets and variables → Actions
    • Click "New repository secret"
    • Name: NPM_TOKEN
    • Value: Paste your npm token
    • Click "Add secret"

2. GITHUB_TOKEN (Automatic)

This token is automatically provided by GitHub Actions and doesn't need manual configuration. It's used for:

  • Git operations (pushing version tags)
  • Creating GitHub releases
  • Accessing repository content

Permissions: The workflow requires these permissions (already configured in .github/workflows/npm-publish.yml):

  • contents: write - For pushing commits and creating releases
  • packages: write - For publishing packages

3. Build Environment Variables (Required)

The build process requires several environment variables for server endpoints. Add these as GitHub secrets:

Server URLs:

  • VITE_SERVER_URL - Default server URL
  • VITE_SERVER_URL_US - US region server URL
  • VITE_SERVER_URL_EU_RESIDENCY - EU region server URL
  • VITE_SERVER_URL_IN_RESIDENCY - India region server URL

WebSocket URLs:

  • VITE_WEBSOCKET_URL - Default WebSocket URL
  • VITE_WEBSOCKET_URL_US - US region WebSocket URL
  • VITE_WEBSOCKET_URL_EU_RESIDENCY - EU region WebSocket URL
  • VITE_WEBSOCKET_URL_IN_RESIDENCY - India region WebSocket URL

Setup Instructions:

  1. Go to your repository on GitHub
  2. Navigate to Settings → Secrets and variables → Actions
  3. For each variable above:
    • Click "New repository secret"
    • Name: Use the exact variable name (e.g., VITE_SERVER_URL_US)
    • Value: Enter the appropriate URL for your environment
    • Click "Add secret"

Note: These variables must be prefixed with VITE_ to be accessible in the Vite build process. The values should be the actual URLs for your ElevenLabs endpoints.

How It Works

  1. When code is merged to main, the workflow automatically:

    • Runs tests and linting
    • Checks if the current version is already published
    • Increments the patch version (e.g., 0.0.15 → 0.0.16)
    • Builds the project
    • Publishes to npm
    • Creates a git tag and GitHub release
    • Commits the version change with [skip ci] to avoid loops
  2. To skip the automated release, include [skip ci] in your commit message.

  3. For manual version control:

    • Minor version: pnpm version:minor
    • Major version: pnpm version:major
    • Pre-release: pnpm version:prerelease

License

MIT © ElevenLabs

Support

For issues and questions, please visit our GitHub repository.