Skip to content

Latest commit

 

History

History

bind2

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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