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

chatkit-vue

v0.1.6

Published

Unofficial Vue 3 bindings for OpenAI ChatKit with Tailwind-styled UI components.

Readme

chatkit-vue

⚠️ Unofficial package. This project is a community-maintained Vue 3 port of OpenAI’s ChatKit bindings and is not published or supported by OpenAI. Please be aware that the API surface is still evolving; breaking changes may occur with little advance notice. Evaluate your tolerance for change before relying on this library in production.

Vue 3 bindings and headless components for building ChatKit experiences with Tailwind-first styling. This package mirrors the ergonomics of @openai/chatkit-react while providing opinionated Vue components for chat history, message rendering, composers, and widget rendering.

Features

  • Vue composables (useChatKit, useStableOptions) that wrap the ChatKit web component and keep options stable across renders.
  • <ChatKit /> wrapper to mount the native <openai-chatkit> element.
  • Tailwind-crafted UI primitives: ChatKitRoot, ChatHistory, ChatMessageList, ChatMessageBubble, ChatComposer, and WidgetRenderer.
  • Complete widget renderer that understands ChatKit widget JSON (Card, ListView, Button, Select, DatePicker, Markdown, etc.) with action forwarding helpers.
  • Ready-to-ship shadcn-inspired styles compiled via Tailwind.

Installation

npm install chatkit-vue @openai/chatkit vue@^3.4
# or
pnpm add chatkit-vue @openai/chatkit vue@^3.4

Import the packaged styles once (typically in your app entry):

import 'chatkit-vue/dist/styles.css';

If you already run Tailwind, you can alternatively import chatkit-vue/src/styles/tailwind.css and merge it with your build.

Quick start

Make sure the ChatKit platform script is present in your document (for Vite apps this typically lives in index.html):

<script src="https://cdn.platform.openai.com/deployments/chatkit/chatkit.js"></script>

Then wire up the hosted client secret helper and mount the component:

<script setup lang="ts">
import { useChatKit, createHostedClientSecret } from 'chatkit-vue';

const { control } = useChatKit({
  api: createHostedClientSecret({
    domainKey: 'domain_pk_XXXXXX',
    url: '/api/session',
    method: 'POST',
  }),
});
</script>

<template>
  <ChatKit :control="control" />
</template>

Rendering widgets

Whenever a message includes ChatKit widget payload, pass it directly to WidgetRenderer:

<WidgetRenderer
  :root="widgetDefinition"
  @action="(action, context) => handleWidgetAction(action, context)"
/>

The component handles all widget node types listed in the ChatKit widget documentation, translating layout primitives (Card, Box, Row, Col) into Tailwind-friendly containers and emitting action events when interactive nodes (Button, Select, DatePicker, ListViewItem) are triggered.

Custom layout

ChatKitRoot composes the included building blocks. You can mix and match individual pieces:

  • ChatHistory – sidebar history list with search, rename, delete hooks.
  • ChatMessageList – scrollable renderer for ChatMessage objects.
  • ChatComposer – shadcn-styled textarea composer with attachments & tools.
  • ChatMessageBubble – role-aware message bubble with widget support.

Because these components are headless, you can wire them to a custom data model or to the OpenAIChatKit instance returned by useChatKit.

Tailwind configuration

The package ships a Tailwind config (tailwind.config.ts) and base styles under src/styles/tailwind.css. If you bundle your own CSS, extend your Tailwind content paths to include:

// tailwind.config.js
module.exports = {
  content: [
    './node_modules/chatkit-vue/dist/**/*.{js,mjs}',
    './node_modules/chatkit-vue/src/**/*.{vue,ts}',
    './src/**/*.{vue,js,ts}',
  ],
};

Handling hosted client secrets

When you integrate with the hosted ChatKit API (getClientSecret) the frontend must request a short-lived client_secret from your backend before the widget can talk to OpenAI. chatkit-vue exposes a helper that wires this up for you with caching, refresh, and optional request customization:

import { createHostedClientSecret, useChatKit } from 'chatkit-vue';

const hosted = createHostedClientSecret({
  url: '/api/chatkit/client-secret',
  headers: () => ({
    Authorization: `Bearer ${window.sessionToken}`,
  }),
  body: () => ({
    user_id: window.currentUserId,
  }),
});

const { control } = useChatKit({
  api: hosted,
});

Your backend endpoint should mint and return JSON with a client_secret property (the helper also recognizes clientSecret and secret). createHostedClientSecret caches the last secret that was issued, retries transparently when the widget asks for a refresh, and lets you override the HTTP method, headers, body, or response parser if your integration needs a custom shape.

Building & testing locally

npm install
npm run test   # Vitest unit tests for composables
npm run build  # Emits ESM/UMD bundles, type declarations, and compiled CSS

License

MIT © ChatKit Vue contributors