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

@dogcalas/sami-chat-widget

v1.0.8

Published

Widget de chat interactivo SaMi - Asistente de elTOQUE

Readme

@dogcalas/sami-chat-widget

Widget de chat interactivo para SaMi, el asistente virtual de elTOQUE.

Instalación

npm install @dogcalas/sami-chat-widget

o con pnpm:

pnpm add @dogcalas/sami-chat-widget

Uso

En Next.js (App Router)

'use client';
import { SamiChat } from '@dogcalas/sami-chat-widget';

export default function MyPage() {
  return (
    <div>
      <h1>Mi Página</h1>
      <SamiChat 
        backendUrl="https://web-bot.eltoque.org"
        initialMessage="¡Hola! Soy SaMi. ¿Cómo puedo ayudarte?"
        buttonPosition="fixed bottom-5 right-5"
      />
    </div>
  );
}

En React (Vite, CRA, etc.)

import { SamiChat } from '@dogcalas/sami-chat-widget';

function App() {
  return (
    <div>
      <h1>Mi Aplicación</h1>
      <SamiChat />
    </div>
  );
}

Props

| Prop | Tipo | Default | Descripción | |------|------|---------|-------------| | backendUrl | string | 'https://web-bot.eltoque.org' | URL del backend del chatbot | | initialMessage | string | '¡Hola! Soy SaMi...' | Mensaje inicial del asistente | | buttonPosition | string | 'fixed bottom-5 right-5' | Clases de Tailwind para posicionar el botón flotante |

Características

  • Server-Sent Events (SSE): Conexión en tiempo real con el backend
  • Persistencia de sesión: Los mensajes se guardan en sessionStorage
  • Reconexión automática: Manejo inteligente de desconexiones
  • Previews de enlaces: Muestra tarjetas enriquecidas para URLs
  • Soporte de imágenes: Detecta y renderiza imágenes automáticamente
  • Diseño responsive: Funciona perfectamente en móviles y escritorio
  • TypeScript: Totalmente tipado para mejor DX

Estilos

El componente utiliza Tailwind CSS. Asegúrate de tener Tailwind configurado en tu proyecto:

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

En tu tailwind.config.js:

module.exports = {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/@dogcalas/sami-chat-widget/dist/**/*.{js,mjs}"
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Tipos TypeScript

interface SamiChatProps {
  buttonPosition?: string;
  initialMessage?: string;
  backendUrl?: string;
}

interface Message {
  id: number;
  role: 'user' | 'assistant';
  content: string;
  image?: string;
  preview?: LinkPreview[] | null;
}

interface LinkPreview {
  url: string;
  title?: string;
  description?: string;
  image?: string;
  source?: string;
}

Desarrollo

# Instalar dependencias
pnpm install

# Compilar en modo watch
pnpm dev

# Compilar para producción
pnpm build

Licencia

MIT © elTOQUE

Soporte

Para reportar problemas o solicitar funcionalidades, abre un issue en GitHub.