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

@retrip-ai/quote-agent-widget

v2.0.0

Published

Embeddable quote agent widget for Retrip - AI-powered travel quote chat

Readme

@retrip-ai/quote-agent-widget

Widget embebible de Retrip para integrar un agente de chat AI en cualquier sitio web.

Características

  • Web Component: Se integra fácilmente con un simple tag HTML
  • Shadow DOM: Estilos completamente aislados del sitio host
  • React + AI SDK: Construido con React 19 y Vercel AI SDK
  • Tailwind v4: Estilos modernos con Tailwind CSS v4
  • TypeScript: Completamente tipado

Instalación

Uso en producción (unpkg)

<retrip-quote-agent-widget 
  agent-id="my-agent-123"
  api-url="https://api.ai.retrip.ai"
  primary-color="#3b82f6"
  input-placeholder="Search for a travel quote..."
  theme="light">
</retrip-quote-agent-widget>

<script src="https://unpkg.com/@retrip-ai/quote-agent-widget" async type="text/javascript"></script>

Desarrollo local

  1. Instalar dependencias:
cd packages/quote-agent-widget
bun install
  1. Construir el widget:
bun run build
  1. Abrir example.html en un navegador para probar localmente.

API

Atributos

  • agent-id (requerido): ID del agente de Mastra a usar
  • api-url (opcional): URL base de la API. Por defecto: https://api.ai.retrip.ai
  • primary-color (opcional): Color primario del widget (ej: #3b82f6)
  • input-placeholder (opcional): Texto placeholder del input
  • theme (opcional): Tema del widget: light, dark, o auto (por defecto: auto)

Ejemplo

<!DOCTYPE html>
<html>
<head>
  <title>Mi Sitio Web</title>
</head>
<body>
  <h1>Bienvenido</h1>
  
  <retrip-quote-agent-widget 
    agent-id="59570699-2ea0-4961-ba3f-659afc7503e0"
    api-url="https://api.ai.retrip.ai"
    primary-color="#3b82f6"
    input-placeholder="¿Qué destino buscas?"
    theme="light">
  </retrip-quote-agent-widget>

  <script src="https://unpkg.com/@retripai/quote-agent-widget" async></script>
</body>
</html>

Desarrollo

Estructura del proyecto

packages/quote-agent-widget/
├── src/
│   ├── index.ts              # Entry point - registra el Web Component
│   ├── widget.tsx             # Custom Element con Shadow DOM
│   ├── styles.css             # Estilos Tailwind v4
│   ├── components/
│   │   ├── chat.tsx          # Componente principal con useChat
│   │   ├── prompt-input.tsx   # Input de mensajes
│   │   ├── message.tsx        # Componente de mensajes
│   │   └── ui/                # Componentes UI básicos
│   └── lib/
│       └── cn.ts              # Utility para clases CSS
├── vite.config.ts             # Configuración de Vite
├── tailwind.config.ts         # Configuración de Tailwind
└── example.html               # Ejemplo de uso

Scripts

  • bun run build: Construye el widget para producción
  • bun run dev: Construye en modo watch
  • bun run typecheck: Verifica tipos TypeScript
  • bun run lint: Ejecuta el linter

Notas Técnicas

  • El widget usa Shadow DOM para aislar completamente los estilos
  • Los estilos de Tailwind se compilan e inyectan directamente en el Shadow DOM
  • React y ReactDOM se bundlean junto con el widget (no son peer dependencies)
  • El widget se conecta a la API de Mastra usando la ruta /agent/:agentId/chat

Licencia

Privado - Retrip