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

679 B

resource-binding

Resource binding for @xmpp/client.

Included and enabled in @xmpp/client.

Usage

Resource is optional and will be chosen by the server if omitted.

string

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

const client = xmpp({ resource: "laptop" });

function

Instead, you can provide a function that will be called every time resource binding occurs (every (re)connect).

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

const client = xmpp({ resource: onBind });

async function onBind(bind) {
  const resource = await fetchResource();
  return resource;
}

References

RFC 6120 Resource Binding