2025-11-05 17:04:23 -03:00

559 B

middleware

Middleware for @xmpp/client and @xmpp/component.

Supports Node.js and browsers.

Install

npm install @xmpp/middleware

Usage

import { Client } from "@xmpp/client";
import middleware from "@xmpp/middleware";

const client = new Client();
const app = middleware({ entity: client });

use

The use method registers a middleware for incoming stanzas.

app.use((ctx, next) => {});

filter

The filter method registers a middleware for outgoing stanzas.

app.filter((ctx, next) => {});