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

@mtchat/vue

v0.4.8

Published

MultitenancyChat Vue.js SDK - embeddable chat component

Readme

@mtchat/vue

Embeddable Vue 3 chat SDK for MTChat.

Use @mtchat/vue when you want a ready-made chat UI, reactive composables, and low-level SDK access from a single package.

Installation

npm install @mtchat/vue

Peer dependencies:

  • vue ^3.4.0

Quick Start

<script setup lang="ts">
import { MTChat, type MTChatConfig } from '@mtchat/vue'

const config: MTChatConfig = {
  baseUrl: 'https://chat.example.com',
  userId: currentUser.id,
  scopeConfig: {
    scopeLevel0: [currentUser.tenantId],
    scopeLevel1: currentUser.departments,
    scopeLevel2: currentUser.permissions,
  },
  userProfile: {
    displayName: currentUser.name,
    company: currentUser.company,
  },
  locale: 'en',
}
</script>

<template>
  <div style="height: 600px;">
    <MTChat :config="config" mode="full" />
  </div>
</template>

Styles are injected by the package bundle. No separate @mtchat/vue/style.css import is required.

Required Config

MTChatConfig requires:

  • baseUrl - MTChat backend URL
  • userId - current user identifier
  • scopeConfig - access scopes used for "Available" dialogs
  • userProfile - display profile used when the user joins dialogs

Optional fields include token, locale, wsUrl, reconnect settings, and WebSocket callbacks.

Authentication Model

The host application is responsible for authentication and identity.

  • If your backend enables JWT auth, pass token in MTChatConfig.
  • If JWT auth is disabled, the SDK still requires userId and scope data from the host app.
  • The SDK does not create users, tenants, or sessions for you.

Main Usage Patterns

Component

<template>
  <MTChat
    :config="config"
    mode="inline"
    :object-id="order.id"
    object-type="order"
    @message-sent="handleMessageSent"
  />
</template>

Composable

import { useChat } from '@mtchat/vue'

const chat = useChat({
  config,
  autoConnect: true,
  objectId: order.id,
  objectType: 'order',
})

await chat.loadParticipatingDialogs()

SDK Client

import { MTChatClient } from '@mtchat/vue'

const client = new MTChatClient(config)

client.connect()

const dialogs = await client.api.getDialogs()
const messages = await client.api.getMessages(dialogs[0].id, { limit: 50 })

client.on('message.new', (event) => {
  console.log('new message', event)
})

Package Contents

  • MTChat - ready-to-use chat component
  • useChat, useFileUpload - Vue composables
  • MTChatClient, MTChatApi, MTChatWebSocket - lower-level SDK
  • exported types for dialogs, messages, attachments, events, and config

PrimeVue

If your app uses PrimeVue, install the companion wrapper:

npm install @mtchat/vue @mtchat/vue-primevue primevue

See the PrimeVue integration guide in docs/sdk/primevue.md.

Documentation

Publishing Checklist

Before publishing:

  • npm run typecheck
  • npm test
  • npm run build
  • npm pack --dry-run

License

MIT