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 🙏

© 2025 – Pkg Stats / Ryan Hefner

parlant-chat-react

v1.0.11

Published

Integrate Parlant agents seamlessly into your React app

Readme

parlant-chat-react

A flexible and customizable React chat component for integrating Parlant agents seamlessly into your website.

Installation

npm install parlant-chat-react
# or
yarn add parlant-chat-react

Quick Start

Here's how to quickly add the chat component to your React application:

import React from 'react';
import ParlantChatbox from 'parlant-chat-react';

function App() {
  return (
    <div>
      <h1>My Application</h1>      
      <ParlantChatbox 
        agentId="AGENT_ID"
        server="PARLANT_SERVER_URL" 
      />
    </div>
  );
}

export default App;

Usage Examples

Basic Embedded Chat

Add a chat interface directly in your page layout:

<ParlantChatbox 
  agentId="AGENT_ID"
  server="PARLANT_SERVER_URL" 
/>

Popup Chat

Display the chat as a popup that can be toggled with a button:

<ParlantChatbox 
  float 
  agentId="AGENT_ID"
  server="PARLANT_SERVER_URL" 
/>

Customized Popup Button

Use a custom button component:

import { Send } from 'lucide-react';

<ParlantChatbox 
  float 
  agentId="AGENT_ID"
  server="PARLANT_SERVER_URL"
  popupButton={<Send color="white" size={24} />} 
/>

Advanced Styling

Apply custom class names to various parts of the chat:

<ParlantChatbox 
  agentId="AGENT_ID"
  server="PARLANT_SERVER_URL"
  classNames={{
    chatboxWrapper: "my-chatbox-wrapper-class",
    chatbox: "my-chatbox-class",
    messagesArea: "my-messages-class",
    agentMessage: "agent-bubble",
    customerMessage: "customer-bubble",
    textarea: "my-input-class",
    popupButton: "my-button-class",
    popupButtonIcon: "my-icon-class",
    chatDescription: "my-description-class",
    bottomLine: "my-footer-class"
  }}
/>

Custom Component Replacement

Replace default UI components with your own:

<ParlantChatbox 
  agentId="AGENT_ID"
  server="PARLANT_SERVER_URL"
  components={{
    popupButton: ({ toggleChatOpen }) => (
      <button onClick={toggleChatOpen}>Chat with us</button>
    ),
    agentMessage: ({ message }) => (
      <div>
        <p>{message.data.message}</p>
        <span>Agent</span>
      </div>
    ),
    customerMessage: ({ message }) => (
      <div>
        <p>{message.data.message}</p>
        <span>You</span>
      </div>
    ),
    header: ({ changeIsExpanded }) => (
      <div>
        <h2>Custom Header</h2>
        <button onClick={changeIsExpanded}>Toggle Expanded</button>
      </div>
    )
  }}
/>

Props

| Prop | Type | Required | Default | Description | |------------------------|----------------|----------|---------|-----------------------------------------------------------------------------| | server | string | Yes | - | API endpoint for chat communication | | sessionId | string | No | - | Unique identifier for an existing chat session | | customerId | string | No | - | Unique identifier for the customer | | titleFn | function | No | - | Function that returns a string to generate dynamic chat session titles | | agentId