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

@ihoomanai/vue-chat

v2.3.0

Published

Vue 3 components and composables for Ihooman Chat Widget - secure Widget ID based initialization

Downloads

623

Readme

@ihooman/vue-chat

Vue 3 components and composables for the Ihooman Chat Widget. Provides native Vue integration with proper lifecycle management and Nuxt 3 compatibility.

Installation

npm install @ihooman/vue-chat
# or
yarn add @ihooman/vue-chat
# or
pnpm add @ihooman/vue-chat

Requirements

Quick Start

Basic Usage

<template>
  <ChatWidget
    widget-id="wgt_abc123def456"
    position="bottom-right"
    @ready="onWidgetReady"
  />
</template>

<script setup>
import { ChatWidget } from '@ihooman/vue-chat';

function onWidgetReady() {
  console.log('Widget ready!');
}
</script>

With Composable

For programmatic control over the widget from any component:

<template>
  <ChatWidget widget-id="wgt_abc123def456" />
  <button @click="open" :disabled="!isReady">
    Need Help?
  </button>
</template>

<script setup>
import { ChatWidget, useChatWidget } from '@ihooman/vue-chat';

const { open, isReady } = useChatWidget();
</script>

Global Plugin Registration

Register the component globally for use anywhere in your app:

// main.ts
import { createApp } from 'vue';
import { IhoomanChatPlugin } from '@ihooman/vue-chat';
import App from './App.vue';

const app = createApp(App);
app.use(IhoomanChatPlugin);
app.mount('#app');

Then use it in any component without importing:

<template>
  <ChatWidget widget-id="wgt_abc123def456" />
</template>

Components

<ChatWidget />

The main component that renders the chat widget.

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | widget-id | string | Yes | Your Widget ID from the Ihooman dashboard | | server-url | string | No | Custom server URL (defaults to production) | | theme | 'light' \| 'dark' | No | Color theme | | position | 'bottom-right' \| 'bottom-left' \| 'top-right' \| 'top-left' | No | Widget position | | start-open | boolean | No | Start with widget open | | user | { name?: string; email?: string; metadata?: Record<string, string> } | No | User information |

See the full props documentation for all available options.

Events

| Event | Payload | Description | |-------|---------|-------------| | @ready | - | Emitted when widget is ready | | @open | - | Emitted when widget opens | | @close | - | Emitted when widget closes | | @message | Message | Emitted on new messages | | @error | Error | Emitted on errors |

Composables

useChatWidget()

Composable for controlling the widget from any component.

<script setup>
import { useChatWidget } from '@ihooman/vue-chat';

const {
  isOpen,      // Ref<boolean> - Whether widget is open
  isReady,     // Ref<boolean> - Whether widget is initialized
  isConnected, // Ref<boolean> - Whether connected to server
  open,        // () => void - Open the widget
  close,       // () => void - Close the widget
  toggle,      // () => void - Toggle open/closed
  sendMessage, // (content: string) => void - Send a message
  setUser,     // (user: UserInfo) => void - Set user info
  clearHistory,// () => void - Clear chat history
  messages,    // Ref<Message[]> - Current messages
  unreadCount, // Ref<number> - Unread message count
} = useChatWidget();
</script>

Examples

With User Information

<template>
  <ChatWidget
    widget-id="wgt_abc123def456"
    :user="{
      name: 'John Doe',
      email: '[email protected]',
      metadata: {
        plan: 'premium',
        customerId: 'cust_123'
      }
    }"
  />
</template>

Custom Styling

<template>
  <ChatWidget
    widget-id="wgt_abc123def456"
    primary-color="#6366f1"
    gradient-from="#6366f1"
    gradient-to="#8b5cf6"
    :border-radius="16"
    font-family="Inter, sans-serif"
  />
</template>

Programmatic Messages

<template>
  <div>
    <button 
      @click="sendMessage('I need help with my order')"
      :disabled="!isReady"
    >
      Order Help
    </button>
    <button 
      @click="sendMessage('How do I reset my password?')"
      :disabled="!isReady"
    >
      Password Help
    </button>
  </div>
</template>

<script setup>
import { useChatWidget } from '@ihooman/vue-chat';

const { sendMessage, isReady } = useChatWidget();
</script>

Nuxt 3

The component is SSR-compatible and defers initialization to the client:

<!-- app.vue or layouts/default.vue -->
<template>
  <div>
    <NuxtPage />
    <ClientOnly>
      <ChatWidget widget-id="wgt_abc123def456" />
    </ClientOnly>
  </div>
</template>

<script setup>
import { ChatWidget } from '@ihooman/vue-chat';
</script>

Or create a Nuxt plugin for global registration:

// plugins/ihooman-chat.client.ts
import { IhoomanChatPlugin } from '@ihooman/vue-chat';

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(IhoomanChatPlugin);
});

Reactive User Updates

<template>
  <ChatWidget 
    widget-id="wgt_abc123def456" 
    :user="currentUser"
  />
</template>

<script setup>
import { ref, computed } from 'vue';
import { ChatWidget } from '@ihooman/vue-chat';

const user = ref({
  name: 'Guest',
  email: ''
});

// User info updates automatically when ref changes
function login(name: string, email: string) {
  user.value = { name, email };
}
</script>

TypeScript

Full TypeScript support is included. Import types as needed:

import type { 
  ChatWidgetProps, 
  UseChatWidgetReturn,
  Message,
  UserInfo 
} from '@ihooman/vue-chat';

Framework Compatibility

  • ✅ Vue 3.0+
  • ✅ Vue 3.4+ (latest)
  • ✅ Nuxt 3
  • ✅ Vite
  • ✅ Vue CLI
  • ✅ Quasar

License

MIT © Ihooman AI