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

evolution-manager-lz

v2.0.0

Published

Modern ES Module wrapper for Evolution API to manage WhatsApp instances

Readme

Evolution Manager LZ

npm version License: MIT

Modern ES Module wrapper for Evolution API to manage WhatsApp instances with full TypeScript support.

✨ Features

  • 🚀 ES Modules: Pure ES6 modules, no CommonJS
  • 🔷 TypeScript: Complete type definitions included
  • 📱 Full WhatsApp API: Complete wrapper for Evolution API
  • 🎯 Modern Syntax: Uses latest JavaScript features
  • 🔐 Secure: Built-in API key authentication
  • 📦 Lightweight: Zero dependencies except axios
  • 🔄 Backward Compatible: Legacy method names supported

📦 Installation

npm install evolution-manager-lz

🚀 Quick Start

import { EvolutionManager } from "evolution-manager-lz";

const manager = new EvolutionManager(
  "https://your-evolution-api.com",
  "your-api-key"
);

// Create a new WhatsApp instance
const instance = await manager.createInstance("my-whatsapp");

// Connect and get QR code
const qrCode = await manager.connectInstance("my-whatsapp");
console.log("QR Code:", qrCode.base64);

// Send a message
await manager.sendMessage("my-whatsapp", "5511999999999", "Hello World!");

📚 API Reference

Instance Management

// Create a new instance
const instance = await manager.createInstance(
  "instanceName",
  "WHATSAPP-BAILEYS"
);

// List all instances
const instances = await manager.listInstances();

// Get specific instance
const instance = await manager.getInstance("instanceName");

// Connect instance (get QR code)
const qrCode = await manager.connectInstance("instanceName");

// Disconnect instance
await manager.disconnectInstance("instanceName");

// Delete instance
await manager.deleteInstance("instanceName");

// Get instance status
const status = await manager.getInstanceStatus("instanceName");

Messaging

// Send text message
await manager.sendMessage("instanceName", "5511999999999", "Hello!");

// Send media (image, video, audio, document)
await manager.sendMedia(
  "instanceName",
  "5511999999999",
  "https://example.com/image.jpg",
  "image",
  "Caption"
);

// Mark message as read
await manager.markAsRead(
  "instanceName",
  "[email protected]",
  false,
  "messageId"
);

Chat Management

// Get chat messages
const messages = await manager.getChatMessages(
  "instanceName",
  "[email protected]",
  50
);

// Get all chats
const chats = await manager.getChats("instanceName");

// Get contacts
const contacts = await manager.getContacts("instanceName");

Settings & Configuration

// Set instance settings
await manager.setInstanceSettings("instanceName", {
  rejectCall: true,
  alwaysOnline: true,
  readMessages: true,
  readStatus: true,
});

// Get instance settings
const settings = await manager.getInstanceSettings("instanceName");

// Set webhook
await manager.setWebhook("instanceName", "https://your-webhook.com/webhook", [
  "message",
  "status",
]);

Utilities

// Get API status
const status = await manager.getApiStatus();

// Get instance profile
const profile = await manager.getProfile("instanceName");

🔧 Configuration Options

Instance Settings

const settings = {
  rejectCall: boolean, // Auto-reject calls
  msgCall: string, // Message when rejecting calls
  groupsIgnore: boolean, // Ignore group messages
  alwaysOnline: boolean, // Always show as online
  readMessages: boolean, // Auto-read messages
  readStatus: boolean, // Auto-read status updates
  syncFullHistory: boolean, // Sync full chat history
  wavoipToken: string, // VoIP token
};

Media Types

  • image - JPEG, PNG, GIF images
  • video - MP4, AVI, MOV videos
  • audio - MP3, WAV, OGG audio files
  • document - PDF, DOC, XLS documents

Integration Types

  • WHATSAPP-BAILEYS (default) - Using Baileys library
  • WHATSAPP-WEB-JS - Using whatsapp-web.js library

🔄 Legacy Compatibility

For backward compatibility, legacy method names are still supported:

// Legacy methods (still work)
const instances = await manager.list();
const instance = await manager.get("instanceName");
const newInstance = await manager.create("instanceName");
const qrCode = await manager.connect("instanceName");
await manager.disconnect("instanceName");
const status = await manager.getStatus();

📝 TypeScript Support

Full TypeScript definitions are included:

import {
  EvolutionManager,
  WhatsAppInstance,
  CreateInstanceResponse,
} from "evolution-manager-lz";

const manager: EvolutionManager = new EvolutionManager(baseUrl, apiKey);
const instances: WhatsAppInstance[] = await manager.listInstances();
const newInstance: CreateInstanceResponse = await manager.createInstance(
  "test"
);

Available Types

  • EvolutionManager - Main class
  • WhatsAppInstance - Instance object structure
  • CreateInstanceResponse - Response from instance creation
  • ConnectionResponse - QR code and connection data
  • MessageResponse - Message send response
  • InstanceSettings - Configuration options
  • EvolutionApiStatus - API status response

🧪 Testing

Run the test suite:

npm test

Test with your own Evolution API:

// test-final.js
import { EvolutionManager } from "./src/evolution-manager.js";

const manager = new EvolutionManager("https://your-api.com", "your-key");
const instances = await manager.listInstances();
console.log(instances);

🌍 Environment Support

  • Node.js: 16.0.0+ (ES Modules support required)
  • Browsers: Modern browsers with ES6 module support
  • TypeScript: 4.0+

📄 License

MIT License - see LICENSE file for details.

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📞 Support

🔗 Related Projects


Made with ❤️ by Leo Zanini