@xpert-ai/chatkit-vue

Vue bindings for Xpert Chatkit
4,457 9
Install
npm install @xpert-ai/chatkit-vue
Latest Version:0.17.0
Vue:3
Last Updated:Oct 21, 2026
Links: GitHub  ·  npm
Maintainer: tiven.wang

@xpert-ai/chatkit-vue

Vue 3 bindings for the Xpert ChatKit web component.

Install

pnpm add @xpert-ai/chatkit-vue

Usage

<script setup lang="ts">
import { ChatKit, useChatKit } from '@xpert-ai/chatkit-vue';

const { control } = useChatKit({
  frameUrl: '<url-to-chatkit-frame>',
  api: {
    apiUrl: 'https://api.xpertai.cn',
    xpertId: 'your-assistant-id',
    getClientSecret: async () => {
      const response = await fetch('/api/create-session', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
      });
      const data = await response.json();

      return {
        secret: data.client_secret,
        organizationId: data.organization_id,
      };
    },
  },
  onReady: () => {
    console.log('ChatKit is ready');
  },
});
</script>

<template>
  <ChatKit :control="control" style="height: 100vh;" />
</template>

getClientSecret may continue returning the legacy string, or return { secret, organizationId } to have ChatKit send organization-id on hosted API requests.

Vite Config

Register the custom element tag in your Vue compiler config:

// vite.config.ts
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag === 'xpertai-chatkit',
        },
      },
    }),
  ],
});

uni-app

This wrapper works for uni-app H5 and web-view targets where Web Components are supported. If you need native mini-program UI, you will need a separate rendering layer.

Related Packages

@xpert-ai/chatkit-vue2

Vue 2 bindings for Xpert Chatkit

3,216 9
@skiyee/oiyo

以融合AI协作、提升开发体验、降低使用心智为目的 UniApp 增强型工程框架

8,700 39
vite-plugin-css-modules-optimize

A css modules optimization plugin for vue

101,944 4
@tdesign/uniapp

TDesign Component for Uniapp

67,985 1,780
@uni-ku/root

借助 Vite 模拟出虚拟的全局组件,解决 Uniapp 无法使用全局共享组件问题

44,742 174

Version History

Version Released License
0.17.0
0.16.2
0.16.1
0.16.0
0.15.0