Skip to content

Latest commit

 

History

History
36 lines (22 loc) · 650 Bytes

README.md

File metadata and controls

36 lines (22 loc) · 650 Bytes

bind2

bind2 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

XEP-0386: Bind 2