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

aws-sns-sms-service

v1.0.0

Published

A simple way to send SMS text messages.

Readme


# AWS-SNS-SMS

Un módulo simple y eficiente para enviar mensajes SMS utilizando **Amazon SNS** (Simple Notification Service) y **Convergia**. Ideal para integraciones rápidas en aplicaciones Node.js que requieren notificaciones SMS.

---

## Instalación

Instala el módulo usando npm:

```bash
npm install aws-sns-sms-service

Requisitos

Amazon SNS

  • Necesitas una cuenta de AWS.
  • Crea un usuario IAM con permisos para enviar SMS a través de SNS.
  • Obtén las credenciales (key_id y access_key) del usuario IAM.

Convergia

  • Necesitas una cuenta en Convergia.
  • Obtén un token de autenticación para usar su API.

Uso

Enviar notificación usando Amazon SNS

const SMSService = require('aws-sns-sms-service');

const parameters = {
    key_id: 'TU_AWS_ACCESS_KEY_ID', // Clave de acceso de AWS
    access_key: 'TU_AWS_SECRET_ACCESS_KEY', // Clave secreta de AWS
    message: 'Este es un mensaje de prueba.', // Mensaje a enviar
    mobiles: ['520000000000'] // Números de teléfono en formato internacional
};

SMSService.sendNotificationAmazonSNS(parameters)
    .then(response => {
        console.log('Respuesta:', response);
    })
    .catch(error => {
        console.error('Error:', error);
    });

Respuesta esperada:

[
    {
        "mobile": "520000000000",
        "message_id": "8c3ed5ae-6dcc-5ba1-ab45-8c145409a148"
    }
]

Enviar notificación usando Convergia

const SMSService = require('aws-sns-sms-service');

const parameters = {
    token: 'TU_TOKEN_DE_CONVERGIA', // Token de autenticación de Convergia
    message: 'Este es un mensaje de prueba.', // Mensaje a enviar
    mobiles: ['520000000000'] // Números de teléfono en formato internacional
};

SMSService.sendNotificationConvergia(parameters)
    .then(response => {
        console.log('Respuesta:', response);
    })
    .catch(error => {
        console.error('Error:', error);
    });

Respuesta esperada:

[
    {
        "group_id": 39681,
        "group_name": "30/01/2025",
        "id": "9d0e070b649640c0923867f6c6f0f009"
    }
]

Manejo de errores

El módulo devuelve errores detallados en caso de que algo falle. Asegúrate de manejar los errores correctamente en tu aplicación.

SMSService.sendNotificationAmazonSNS(parameters)
    .then(response => {
        console.log('Respuesta:', response);
    })
    .catch(error => {
        console.error('Error al enviar el SMS:', error);
    });

Validación de parámetros

El módulo valida los parámetros antes de enviar los mensajes. Asegúrate de proporcionar los datos correctos:

  • key_id y access_key son obligatorios para Amazon SNS.
  • token es obligatorio para Convergia.
  • message debe ser una cadena no vacía.
  • mobiles debe ser un array de números de teléfono en formato internacional.

Documentación oficial

Amazon SNS

Para más detalles sobre cómo configurar Amazon SNS, consulta la documentación oficial de AWS.

Convergia

Consulta la documentación de Convergia para obtener más información sobre su API.


Contribución

¡Las contribuciones son bienvenidas! Si deseas mejorar este módulo, sigue estos pasos:

  1. Haz un fork del repositorio.
  2. Crea una rama para tu feature (git checkout -b feature/nueva-funcionalidad).
  3. Haz commit de tus cambios (git commit -m 'Añadir nueva funcionalidad').
  4. Haz push a la rama (git push origin feature/nueva-funcionalidad).
  5. Abre un Pull Request.

Licencia

Este proyecto está licenciado bajo la MIT License.


Changelog

v1.0.0

  • Lanzamiento inicial del módulo.
  • Soporte para Amazon SNS y Convergia.

Soporte

Si tienes alguna pregunta o encuentras algún problema, por favor abre un issue en el repositorio.