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

@nykk/ur-agent-widget

v0.3.5

Published

Embeddable <ur-agent-chat> Web Component (floating chat bubble) for ur agents, built on @nykk/ur-agent-client

Readme

@nykk/ur-agent-widget

Widget de chat embebible para agentes de ur: un Web Component <ur-agent-chat> sin dependencias de framework que pinta una burbuja flotante con panel de conversación. Toda la comunicación con el backend la delega en @nykk/ur-agent-client.

Instalación

npm install @nykk/ur-agent-widget

Paquete público en npmjs. No requiere ningún registro privado.

Uso como <script> (embed en cualquier web)

El backend de ur ya sirve el bundle listo para embeber en /widget.js. El admin de ur muestra el snippet mínimo (solo data-agent) al configurar el canal widget de un agente; el resto de atributos son opcionales:

<script
  src="https://<tu-backend-ur>/widget.js"
  data-agent="<identifier-del-agente>"
  data-title="Asistente virtual"
  data-color="#6366f1"
></script>

El script lee sus atributos data-* e inyecta un <ur-agent-chat> flotante en document.body. Atributos disponibles: data-agent, data-api-base, data-channel, data-title, data-color, data-color-text, data-color-bot, data-context.

data-context es un objeto JSON con datos por turno para las tools del agente, agrupados por tool — p. ej. data-context='{"visitor_context":{"page":"/precios"}}'. Desde JavaScript es mejor asignar la propiedad, que evita el parseo y permite actualizarla al navegar:

document.querySelector('ur-agent-chat').context = { visitor_context: { page: '/precios' } };

Qué claves acepta cada agente lo declaran sus tools, y el admin muestra el snippet exacto. Ojo: el canal es anónimo, así que estos valores son falsificables — sirven para indicar qué mirar, nunca para decidir qué puede ver quien pregunta.

El mismo bundle IIFE viene en el paquete como @nykk/ur-agent-widget/widget.js, por si prefieres servirlo tú.

Uso como módulo ES (dentro de tu app)

import '@nykk/ur-agent-widget';
<ur-agent-chat
  agent="<identifier-del-agente>"
  api-base="https://<tu-backend-ur>"
  title="Asistente virtual"
></ur-agent-chat>

Al importarlo como módulo no se auto-monta nada: tú colocas el elemento. Atributos observados: agent, subject, api-base, channel, title, started-at, color, color-text, color-bot.

Personalización

Los colores y medidas se exponen como variables CSS en el :host (--uw-primary, --uw-bg, --uw-text, --uw-radius, --uw-panel-width, --uw-panel-height, entre otras).

Licencia

MIT