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

@mazaal-dev/widget

v1.1.4

Published

AI Agent widget for embedding on any website.

Readme

🤖 Mazaal Chat Widget

A lightweight, embeddable AI chat widget for any website. Built with React and TypeScript, designed to be easily integrated and highly customizable.

🚀 Quick Start

Basic Integration

<!-- Mazaal AI Chat Widget -->
<script src="https://cdn.jsdelivr.net/npm/@mazaal-dev/widget@latest/dist/mazaal-widget.iife.js" async 
  onload='window.mazaalWidget = window.ChatWidget?.init({
    agentId: "cmf6eh6mq00019kz13qk7zwe0",
    apiUrl: "https://api.mazaal.ai",
    title: "Demo Agent",
    subtitle: "We'\''re here to help",
    primaryColor: "#FF6A2A",
    position: "bottom-right",
    theme: "light",
    welcomeMessage: "Hi! How can I help you today?",
    placeholder: "Type your message here...",
    enableIdentification: true,
    identifyAfterMessages: 3,
    identificationFields: { name: true, email: true, phone: false, company: false }
  })'>
</script>
<!-- End Mazaal AI Chat Widget -->

📚 Enhanced Examples

For comprehensive examples, advanced configurations, and use cases, see our Enhanced Generator Samples documentation.

⚙️ Configuration Options

interface WidgetConfig {
  // Required
  agentId: string;                   // Your AI agent ID
  
  // Optional
  apiUrl?: string;                   // API base URL (default: https://api.mazaal.ai)
  theme?: 'light' | 'dark';          // Theme (default: light)
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
  welcomeMessage?: string;           // Initial bot message
  placeholder?: string;              // Input placeholder text
  primaryColor?: string;             // Brand color (default: #FF6A2A)
  logo?: string;                     // Logo URL for header
  title?: string;                    // Widget title
  subtitle?: string;                 // Widget subtitle
  agentName?: string;                // Agent name for display
  enableMarkdown?: boolean;          // Enable markdown parsing (default: true)
  enableAttachments?: boolean;       // Enable file uploads (default: false)
  maxHeight?: number;                // Max widget height (default: 600)
  maxWidth?: number;                 // Max widget width (default: 400)
  zIndex?: number;                   // CSS z-index (default: 1000)
  showAvatar?: boolean;              // Show agent avatar (default: true)
  enableNotifications?: boolean;     // Enable browser notifications (default: true)
  
  // Identification settings
  enableIdentification?: boolean;    // Enable user identification (default: false)
  identifyAfterMessages?: number;    // Ask for ID after X messages (default: 3)
  identificationFields?: {           // Which fields to collect
    name?: boolean;
    email?: boolean;
    phone?: boolean;
    company?: boolean;
  };
  identificationRequired?: boolean;  // Make identification mandatory (default: false)
  identificationMessage?: string;    // Custom ID request message
}

Dynamic Configuration Updates

// Update widget configuration after initialization
if (window.mazaalWidget) {
  window.mazaalWidget.updateConfig({
    primaryColor: "#e91e63",
    title: "New Title",
    welcomeMessage: "Updated welcome message!"
  });
}

Multiple Widget Instances

// Support widget
const supportWidget = ChatWidget.init({
  agentId: "support-agent-id",
  position: "bottom-right",
  primaryColor: "#007bff",
  title: "Customer Support",
  enableIdentification: true,
  identificationRequired: true
});

// Sales widget
const salesWidget = ChatWidget.init({
  agentId: "sales-agent-id", 
  position: "bottom-left",
  primaryColor: "#28a745",
  title: "Sales Team",
  enableIdentification: true,
  identifyAfterMessages: 1
});

Error Handling

// Simple error handling
(function() {
  if (window.mazaalWidgetInitialized) return;
  
  const script = document.createElement('script');
  script.src = 'https://cdn.jsdelivr.net/npm/@mazaal-dev/widget@latest/dist/mazaal-widget.iife.js';
  script.async = true;
  
  script.onload = function() {
    if (window.ChatWidget) {
      window.mazaalWidget = window.ChatWidget.init({
        agentId: "your-agent-id",
        apiUrl: "https://api.mazaal.ai"
      });
      window.mazaalWidgetInitialized = true;
    }
  };
  
  script.onerror = function() {
    console.error('Failed to load Mazaal widget');
  };
  
  document.head.appendChild(script);
})();