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

@wysdym/agent

v1.20.2

Published

Official Wysdym Chat Widget for React applications. Embed an AI-powered voice and chat assistant into your website with just a few lines of code.

Readme

@wysdym/agent

Official Wysdym Chat Widget for React applications. Embed an AI-powered voice and chat assistant into your website with just a few lines of code.

npm version npm downloads

Installation

npm install @wysdym/agent

Peer Dependencies: React ≥18 and React-DOM ≥18 are required.


⚠️ CSS Import Required

You must import the widget styles for the widget to render correctly:

import '@wysdym/agent/style.css';

Without this import, the widget will appear unstyled or broken. This is the most common setup issue.


Quick Start

import { WysdymWidget } from '@wysdym/agent';
import '@wysdym/agent/style.css';  // Required!

export function App() {
  return (
    <WysdymWidget
      agentId="your-agent-id"
      mode="floating"
      position="bottom-right"
    />
  );
}

That's it! The widget will appear as a floating button in the bottom-right corner of your page.


Display Modes

Floating Mode (Default)

A floating button appears in the corner of the screen. When clicked, it expands into a chat interface.

<WysdymWidget
  agentId="your-agent-id"
  mode="floating"
  position="bottom-right"
/>

Inline Mode

The widget embeds directly into your page layout, useful for dedicated support pages or embedded experiences.

<WysdymWidget
  agentId="your-agent-id"
  mode="inline"
/>

Props Reference

WysdymWidget (Recommended)

The primary component for most use cases.

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | agentId | string | ✓ | — | Your Wysdym agent ID | | mode | 'floating' \| 'inline' | | 'floating' | Display mode | | position | 'bottom-right' \| 'bottom-left' | | 'bottom-right' | Floating button position | | theme | 'light' \| 'dark' | | — | Color theme | | primaryColor | string | | — | Primary brand color (CSS value) | | expandable | boolean | | — | Allow expand/collapse by user | | deferInit | boolean | | — | Defer initialization until triggered |

ChatWidget (Advanced)

A lower-level component with full configuration options. Use when you need fine-grained control over the widget's appearance and behavior.

import { ChatWidget } from '@wysdym/agent';
import '@wysdym/agent/style.css';

<ChatWidget
  agentId="your-agent-id"
  primaryColor="#BA6296"
  mode="floating"
  onExpandChange={(expanded) => console.log('Widget expanded:', expanded)}
/>

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | agentId | string | ✓ | — | Your Wysdym agent ID | | mode | 'floating' \| 'inline' | | 'floating' | Display mode | | primaryColor | string | | '#BA6296' | Primary brand color | | secondaryColor | string | | '#A0527A' | Secondary brand color | | isExpanded | boolean | | false | Start widget in expanded state | | onExpandChange | (expanded: boolean) => void | | — | Callback when expanded state changes | | backendUrl | string | | production URL | Custom backend URL (self-hosted) | | widgetTriggerText | string | | 'Need help?' | Text shown on trigger button | | widgetTriggerButtonText | string | | 'Start a call' | Button text for trigger | | widgetTriggerButtonIcon | string | | 'Phone' | Icon name for trigger button | | emailCollectionButtonText | string | | 'Submit' | Email form submit button text | | emailCollectionButtonIcon | string | | 'ArrowRight' | Email form button icon | | greetingTooltipEnabled | boolean | | true | Show proactive greeting tooltip | | greetingTooltipText | string | | — | Custom tooltip text | | initialAgentName | string | | — | Agent name (before config loads) | | initialAgentFirstMessage | string | | — | First message (before config loads) |


Styling

CSS Import Options

// Recommended: Clean import path
import '@wysdym/agent/style.css';

// Alternative: Direct path
import '@wysdym/agent/dist/index.css';

Style Isolation

Widget styles are scoped to .wysdym-widget-container and will not affect your application's global styles:

  • Widget styles only apply inside the widget container
  • Your existing Tailwind or custom CSS classes are unaffected
  • No CSS reset or preflight styles leak to your host application

Custom Branding

Use primaryColor and secondaryColor props to match your brand:

<WysdymWidget
  agentId="your-agent-id"
  primaryColor="#6366F1"  // Indigo
/>

Non-React / CDN Usage

For websites not using React, embed the widget via a script tag:

<script
  src="https://storage.googleapis.com/wysdym-widget-cdn-production/widget-loader.js"
  data-auto-load="true"
  data-agent-id="your-agent-id"
  data-mode="floating"
  data-position="bottom-right"
  async
></script>

Generating Embed Code Programmatically

import { getEmbedCode } from '@wysdym/agent';

const embedCode = getEmbedCode('your-agent-id', {
  mode: 'floating',
  position: 'bottom-right'
});

console.log(embedCode);
// <script src="..."></script>

TypeScript Support

Full TypeScript definitions are included. Import types as needed:

import type {
  WysdymWidgetProps,
  ChatWidgetProps,
  GetEmbedCodeOptions,
  EmbedMode,
  FloatingPosition,
  DisplayMode,
} from '@wysdym/agent';

Changelog

See the GitHub Releases page for version history and release notes.


Support


License

MIT © Wysdym