Connection and credential options.
The live session, bound and ready.
import { connect } from 'edgeport/xmpp';
await using xmpp = await connect({
jid: 'juliet@example.com',
password: env.XMPP_PW,
tls: 'starttls'
});
await xmpp.setPresence('online');
await xmpp.send({ to: 'romeo@example.com', body: 'wherefore art thou' });
for await (const msg of xmpp.messages()) console.log(msg.from, msg.body);
Connects to an XMPP server, authenticates, binds a resource, and returns a live session.
Dials the core transport (implicit TLS for
tls: 'implicit', otherwise plaintext that STARTTLS may upgrade), runs the RFC 6120 handshake, and starts a background pump that routes inbound stanzas. Useawait using(or XmppSession.close) to release the connection.