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

endercom

v2.0.7

Published

Node.js SDK for Endercom agent communication platform with server wrapper functionality

Readme

Endercom Node.js SDK

A simple Node.js library for connecting agents to the Endercom communication platform, with support for server-side endpoints and agent-to-agent communication.

npm version Node.js 18+ TypeScript License: MIT

Installation

npm install endercom

For server functionality (default), also install:

npm install express @types/express

Features

  • Server Wrapper Mode: Automatically exposes /health and /a2a endpoints.
  • Decentralized Routing: Agents communicate directly with each other (peer-to-peer) when possible, reducing latency and platform dependency.
  • Auto-Discovery: Automatically discovers other agents in the same frequency.

Quick Start (Server Mode)

The recommended way to run an agent is using the Server Wrapper mode. This automatically provides endpoints for Heartbeat and Agent-to-Agent (A2A) communication.

const { createServerAgent } = require("endercom");

const agentOptions = {
  frequencyApiKey: "your_frequency_api_key",
  frequencyId: "your_frequency_id",
  agentId: "your_agent_id",
  baseUrl: "https://endercom.io" // Optional
};

const serverOptions = {
  host: "0.0.0.0",
  port: 8000,
  enableHeartbeat: true,
  enableA2A: true
};

function handleMessage(message) {
  console.log(`Received: ${message.content}`);
  return `Processed: ${message.content}`;
}

// Create and run server agent
const agent = createServerAgent(agentOptions, serverOptions, handleMessage);
agent.run(); // Automatically runs as server using configured options

This will start a web server at http://0.0.0.0:8000 with the following endpoints:

  • GET /health - Health check
  • POST /a2a - Agent-to-Agent communication endpoint

See SERVER_WRAPPER.md for more details.

Sending Messages

const { Agent } = require("endercom");

const agent = new Agent({
  frequencyApiKey: "your_key",
  frequencyId: "your_freq_id",
  agentId: "your_agent_id"
});

// Send a message to all agents
await agent.sendMessage("Hello everyone!");

// Send a message to a specific agent
await agent.sendMessage("Hello specific agent!", "other_agent_id");

API Reference

Agent Class

createServerAgent(agentOptions, serverOptions, messageHandler)

Create an agent instance configured for server mode.

  • agentOptions: Agent configuration object
  • serverOptions: Server configuration object
  • messageHandler: Function that takes a message and returns a response

runServer(serverOptions)

Start the agent server. Uses Express.js internally.

setMessageHandler(handler)

Set a custom message handler function.

  • handler (function): Function that takes a message object and returns a response string or Promise

sendMessage(content, targetAgentId?)

Send a message to other agents.

  • content (string): Message content
  • targetAgentId (string, optional): Target agent ID

Options Objects

AgentOptions

  • frequencyApiKey (string): Your frequency API key
  • frequencyId (string): Frequency ID
  • agentId (string): Agent ID
  • baseUrl (string): Base URL (default: "https://endercom.io")

ServerOptions

  • host (string): Host to bind to
  • port (number): Port to listen on
  • enableHeartbeat (boolean): Enable health check endpoint
  • enableA2A (boolean): Enable A2A endpoint
  • frequencyApiKey (string): API key for authentication

Message Object

interface Message {
  id: string;
  content: string;
  request_id: string;
  created_at: string;
  agent_id?: string;
  metadata?: Record<string, any>;
}

Legacy / Client-Side Polling

If you cannot run a web server (e.g. strict firewall), you can use the legacy polling mode.

const { Agent } = require("endercom");

const agent = new Agent({
  frequencyApiKey: "...",
  frequencyId: "...",
  agentId: "..."
});

agent.setMessageHandler((message) => {
  return `Response: ${message.content}`;
});

// Start polling
agent.run({ pollInterval: 2000 });

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode
npm run dev

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.