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

skailan-conversations

v1.0.0

Published

Servicio de conversaciones y mensajería para Skailan

Downloads

6

Readme

@skailan/conversations

Servicio de conversaciones y mensajería para la plataforma Skailan.

Descripción

Este módulo proporciona funcionalidades completas de mensajería y gestión de conversaciones para la plataforma Skailan. Incluye:

  • Gestión de conversaciones en tiempo real
  • Integración con múltiples plataformas (WhatsApp, Telegram, Email)
  • Sistema de canales y mensajes
  • Webhooks para plataformas externas
  • Socket.IO para comunicación en tiempo real
  • Gestión de archivos y multimedia

Instalación

npm install @skailan/conversations

Uso

Importación básica

import { ConversationService } from '@skailan/conversations';

const conversationService = new ConversationService();

// Crear una nueva conversación
const conversation = await conversationService.createConversation({
  contactId: "contact-123",
  platform: "whatsapp",
  organizationId: "org-123"
});

Configuración de variables de entorno

DATABASE_URL="postgresql://user:password@localhost:5432/skailan"
REDIS_URL="redis://localhost:6379"
TELEGRAM_BOT_TOKEN="your-telegram-bot-token"

API Endpoints

Conversaciones

  • GET /conversations - Listar conversaciones
  • POST /conversations - Crear conversación
  • GET /conversations/:id - Obtener conversación
  • PUT /conversations/:id - Actualizar conversación
  • DELETE /conversations/:id - Eliminar conversación

Mensajes

  • GET /conversations/:id/messages - Listar mensajes
  • POST /conversations/:id/messages - Enviar mensaje
  • GET /messages/:id - Obtener mensaje
  • PUT /messages/:id - Actualizar mensaje

Canales

  • GET /channels - Listar canales
  • POST /channels - Crear canal
  • GET /channels/:id - Obtener canal
  • PUT /channels/:id - Actualizar canal

Webhooks

  • POST /webhooks/telegram - Webhook de Telegram
  • POST /webhooks/whatsapp - Webhook de WhatsApp

Características

  • Tiempo real: Socket.IO para comunicación instantánea
  • Múltiples plataformas: Soporte para WhatsApp, Telegram, Email
  • Gestión de archivos: Subida y gestión de multimedia
  • Webhooks: Integración con plataformas externas
  • Multitenancy: Aislamiento de datos por organización
  • Historial completo: Registro de todas las interacciones

Dependencias

  • Express.js para el servidor web
  • Socket.IO para comunicación en tiempo real
  • Prisma para ORM
  • Redis para cache y sesiones
  • @skailan/core para autenticación

Desarrollo

# Instalar dependencias
npm install

# Ejecutar en modo desarrollo
npm run dev

# Construir para producción
npm run build

# Generar cliente Prisma
npm run prisma:generate

Ejemplos de uso

Enviar mensaje a través de WhatsApp

import { ConversationService } from '@skailan/conversations';

const conversationService = new ConversationService();

const message = await conversationService.sendMessage({
  conversationId: "conv-123",
  content: "Hola, ¿cómo estás?",
  type: "text",
  platform: "whatsapp"
});

Escuchar mensajes en tiempo real

import { io } from 'socket.io-client';

const socket = io('http://localhost:3007');

socket.on('new_message', (message) => {
  console.log('Nuevo mensaje:', message);
});

socket.on('conversation_updated', (conversation) => {
  console.log('Conversación actualizada:', conversation);
});

Webhooks

Telegram Webhook

// Configurar webhook de Telegram
app.post('/webhooks/telegram', async (req, res) => {
  const { message } = req.body;
  
  await conversationService.processTelegramMessage(message);
  
  res.status(200).send('OK');
});

Licencia

MIT