Resource binding for @xmpp/client
.
Included and enabled in @xmpp/client
.
Resource is optional and will be chosen by the server if omitted.
import { xmpp } from "@xmpp/client";
const client = xmpp({ resource: "laptop" });
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;
}