I have a basic XMPP client working on strophe.js.
On login I create handlers such as
connect = new Strophe.Connection(\'http://localhost/http-bind\'); ..
Or may be you can create a module for Strophe and then include the module in your app, and then include strophe as a variable where ever you want to use it.