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

waxion-api

v1.0.1

Published

Client officiel pour l'API WhatsApp WAxion - Envoyez des messages, gérez vos conversations et automatisez WhatsApp facilement

Downloads

5

Readme

WAxion API - Client npm officiel

Client Node.js simple et puissant pour l'API WhatsApp WAxion.

🚀 Installation

npm install waxion-api

📖 Utilisation rapide

Envoyer un message

const WAxionAPI = require('waxion-api');

const client = new WAxionAPI('VOTRE_API_KEY', '1d7a184319266ff3075bc61d22b9b2b62dbf1c9620cb1889bd5a0257a7def7e6');

// Message texte
await client.sendMessage('24104570040', 'Bonjour depuis npm!');

// Message avec média
await client.sendMedia(
  '24104570040',
  'https://example.com/image.jpg',
  'image',
  'Voici une image!'
);

Vérifier le statut

const status = await client.getStatus();
console.log(status);
// { appName: "Mon App", connected: true, phoneNumber: "24104570040" }

Récupérer les messages

// Messages reçus
const received = await client.getReceivedMessages(50);
console.log(received.messages);

// Messages envoyés
const sent = await client.getSentMessages(50);
console.log(sent.messages);

Chatbot en temps réel (WebSocket)

const client = new WAxionAPI('VOTRE_API_KEY', 'VOTRE_API_SECRET');

// Connecter au WebSocket
await client.connectWebSocket();

// Gérer les messages entrants
client.onMessage((from, message, event) => {
  console.log(`Message de ${from}: ${message}`);
  
  // Répondre automatiquement
  client.reply(from, `Vous avez dit: ${message}`);
});

// Événements
client
  .on('open', () => console.log('✅ Connecté'))
  .on('close', () => console.log('🔌 Déconnecté'))
  .on('error', (err) => console.error('❌ Erreur:', err));

Chatbot avec OpenAI

const WAxionAPI = require('waxion-api');
const { OpenAI } = require('openai');

const client = new WAxionAPI('VOTRE_API_KEY', 'VOTRE_API_SECRET');
const openai = new OpenAI({ apiKey: 'VOTRE_OPENAI_KEY' });

await client.connectWebSocket();

client.onMessage(async (from, message) => {
  console.log(`🤖 Message reçu: "${message}"`);
  
  try {
    const completion = await openai.chat.completions.create({
      model: 'gpt-3.5-turbo',
      messages: [
        { role: 'system', content: 'Tu es un assistant WhatsApp amical.' },
        { role: 'user', content: message }
      ]
    });
    
    const reply = completion.choices[0].message.content;
    client.reply(from, reply);
    console.log(`✅ Réponse: "${reply}"`);
  } catch (error) {
    console.error('Erreur OpenAI:', error.message);
  }
});

📚 API

new WAxionAPI(apiKey, apiSecret, options)

Crée une nouvelle instance du client.

Options:

  • baseUrl: URL de base de l'API (défaut: apiwx.alissa-ia.ga)
  • wsUrl: URL WebSocket (défaut: wss://apiwx.alissa-ia.ga/ws)

Méthodes REST

  • sendMessage(phone, message) - Envoyer un message texte
  • sendMedia(phone, mediaUrl, mediaType, caption) - Envoyer un média
  • getStatus() - Vérifier le statut de connexion
  • getReceivedMessages(limit) - Récupérer les messages reçus
  • getSentMessages(limit) - Récupérer les messages envoyés

Méthodes WebSocket

  • connectWebSocket() - Se connecter au WebSocket
  • onMessage(handler) - Gérer les messages entrants
  • reply(phone, message) - Répondre via WebSocket
  • on(event, handler) - Écouter les événements (open, close, error)
  • disconnect() - Fermer la connexion WebSocket

🔐 Sécurité

  • ⚠️ Ne committez jamais vos clés API dans Git
  • Utilisez des variables d'environnement: process.env.WAXION_API_KEY
  • Stockez les clés dans un fichier .env avec dotenv

📞 Support

  • 📧 Email: [email protected]
  • 📱 WhatsApp: +24174570040
  • 📖 Documentation complète: https://apiwx.alissa-ia.ga

📝 Licence

MIT © WAxion AI */