MCPcopy Index your code
hub / github.com/stomp-js/stompjs

github.com/stomp-js/stompjs @v7.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v7.3.0 ↗ · + Follow
632 symbols 1,161 edges 92 files 149 documented · 24% 5 cross-repo links updated 2mo agov7.4.0-beta.2 · 2026-05-07★ 88719 open issues

Browse by type

Functions 486 Types & classes 146
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

STOMP.js

Build Status - Firefox, Chrome Build Status - Safari, Edge Node.js Tests API Docs Refresh

STOMP.js is a fully-fledged STOMP over WebSocket library for browsers and Node.js, providing seamless integration with STOMP protocol-compliant messaging brokers.

Table of Contents

Introduction

This library enables clients to connect to STOMP brokers over WebSocket (or TCP). It fully implements the STOMP protocol specifications (v1.0, v1.1, and v1.2), making it compatible with any broker that supports STOMP or STOMP over WebSocket.

Popular brokers like RabbitMQ, ActiveMQ, and others provide support for STOMP and STOMP over WebSockets out-of-the-box.

Features

  • Simple and intuitive API for interacting with the STOMP protocol
  • Support for STOMP protocol versions: 1.2, 1.1, and 1.0
  • Support for fallback options when WebSocket is unavailable
  • Supports both browser and Node.js environments
  • Option to connect using STOMP over TCP
  • Full support for binary payloads
  • Compatible with RxJS for reactive programming

Getting Started

This section provides a quick guide to integrating STOMP.js into your browser or Node.js application.

Browser

To use STOMP.js in a browser:

  1. Add the following in your HTML file: ```html

```

  1. Use the library: ```javascript import { Client } from '@stomp/stompjs';

const client = new Client({ brokerURL: 'ws://localhost:15674/ws', onConnect: () => { client.subscribe('/topic/test01', message => console.log(Received: ${message.body}) ); client.publish({ destination: '/topic/test01', body: 'First Message' }); }, });

client.activate(); ```

Node.js

To use STOMP.js in a Node.js environment:

  1. Install the package: bash npm install @stomp/stompjs ws

  2. Use it in your application: ```javascript import { Client } from '@stomp/stompjs';

import { WebSocket } from 'ws'; Object.assign(global, { WebSocket });

const client = new Client({ brokerURL: 'ws://localhost:15674/ws', onConnect: () => { client.subscribe('/topic/test01', message => console.log(Received: ${message.body}) ); client.publish({ destination: '/topic/test01', body: 'First Message' }); }, });

client.activate(); ```


Documentation

Comprehensive documentation can be found at: STOMP.js Documentation

Upgrading

If you are updating from an older version of STOMP.js, review the Upgrading Guide for any required changes.

Usage with RxJS

Rx-Stomp builds upon this library, exposing all its features as RxJS Observables, enabling reactive programming patterns.

TypeScript Support

STOMP.js includes built-in TypeScript definitions, eliminating the need for external type definition files. Begin coding with TypeScript out-of-the-box!

Changelog

Visit the Change Log for information about changes, improvements, and fixes in recent releases.

Contributing

Thinking of contributing to STOMP.js? Great! To get started:

  • Read the Contributing Guide for development instructions.
  • Report bugs or suggest features by creating an issue on GitHub.

We welcome contributions from the community!

Authors

This library is made possible by these amazing contributors:

This library is originally based on stompjs by Jeff Mesnil with enhancements and bug fixes from Jeff Lindsay and Vanessa Williams.

License

Licensed under the Apache-2.0 License. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 464
Class 120
Function 22
Interface 18
Enum 8

Languages

TypeScript100%

Modules by API surface

bundles/stomp.umd.js132 symbols
bundles/stomp.umd.min.js127 symbols
src/client.ts29 symbols
esm6/client.js29 symbols
src/stomp-handler.ts24 symbols
esm6/stomp-handler.js24 symbols
src/parser.ts18 symbols
esm6/parser.js18 symbols
src/frame-impl.ts17 symbols
esm6/frame-impl.js17 symbols
spec/helpers/wrapper-ws.js14 symbols
spec/helpers-src/wrapper-ws.ts14 symbols

For agents

$ claude mcp add stompjs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page