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

@convokit/widget

v0.1.3

Published

AI chat widget for your website

Downloads

1,304

Readme

@convokit/widget

Add an AI-powered chat widget to any React or Next.js app in minutes. ConvoKit handles the AI, knowledge base, and conversations — you just drop in a component.

Website: convokit.dev


Get started in 5 steps

1. Sign upconvokit.dev

2. Generate your API key → from the ConvoKit dashboard

3. Upload your documents → add your knowledge base (docs, FAQs, support content)

4. Install the library

npm install @convokit/widget
# or
yarn add @convokit/widget
# or
pnpm add @convokit/widget

5. Add the widget → paste your key and you're live

<PopupWidget apiKey="pk_live_..." />

That's it. ConvoKit trains on your documents and starts answering questions immediately.


Quick start

React / Vite

import { PopupWidget } from '@convokit/widget';

export function App() {
  return (
    <div>
      {/* your app */}
      <PopupWidget apiKey={import.meta.env.VITE_CONVOKIT_KEY ?? ''} />
    </div>
  );
}

Next.js App Router (recommended)

Use the built-in Next.js entry — no need to write dynamic() yourself:

// app/layout.tsx
import { PopupWidgetNext } from '@convokit/widget/next';

export default function Layout({ children }) {
  return (
    <html><body>
      {children}
      <PopupWidgetNext apiKey={process.env.NEXT_PUBLIC_CONVOKIT_KEY ?? ''} />
    </body></html>
  );
}

PopupWidgetNext uses next/dynamic with ssr: false automatically and reads NEXT_PUBLIC_CONVOKIT_KEY if you don't pass apiKey.

Next.js App Router (manual dynamic import)

'use client';
import dynamic from 'next/dynamic';

const PopupWidget = dynamic(
  () => import('@convokit/widget').then((m) => m.PopupWidget),
  { ssr: false }
);

export default function Layout({ children }) {
  return (
    <>
      {children}
      <PopupWidget apiKey={process.env.NEXT_PUBLIC_CONVOKIT_KEY ?? ''} />
    </>
  );
}

No separate CSS import needed — styles are bundled.


Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | apiKey | string | required | Your ConvoKit public key (pk_live_... or pk_test_...) | | title | string | 'Support' | Widget header title | | welcomeMessage | string | 'Hi! How can we help?' | First message shown to the user | | instanceId | string | 'convokit-widget' | Unique identifier for this widget instance | | primaryColor | string | — | Accent color (e.g. '#7c3aed') | | position | 'bottom-right' \| 'bottom-left' \| 'bottom-middle' \| 'top-right' \| 'top-left' \| 'top-middle' | 'bottom-right' | Bubble position on screen | | persistMessages | boolean | false | Restore chat history on page reload | | logoUrl | string | — | Custom icon shown in the chat bubble (SVG, PNG, JPG) |


Fixing duplicate React errors in Next.js

If you see Cannot read properties of undefined (reading 'ReactCurrentDispatcher'), add this to next.config.js:

const nextConfig = {
  transpilePackages: ['@convokit/widget'],
  webpack: (config) => {
    config.resolve.alias = {
      ...config.resolve.alias,
      react: require.resolve('react'),
      'react-dom': require.resolve('react-dom'),
    };
    return config;
  },
};
module.exports = nextConfig;

License

MIT