Skip to content

Commit 4ee2022

Browse files
committed
Give a brief description on how to use plugins. Updates #11
1 parent ef3fab0 commit 4ee2022

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.markdown

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ This is a collection of Strophe.js plugins created and maintained by the
77
community. The homepage for this collection is
88
https://github.com/strophe/strophejs-plugins .
99

10+
## How to use
11+
12+
Strophe plugins extend the Strophe.Connection object by calling
13+
``Strophe.addConnectionPlugin``.
14+
15+
This enables us to then access the plugin as an attribute on the connection
16+
object.
17+
18+
For example, here the "roster" plugin is used:
19+
20+
``
21+
var connection = new Strophe.Connection(converse.bosh_service_url);
22+
connection.roster.get(function () {});
23+
``
24+
1025
## Available Plugins
1126

1227
### XMPP Extensions

0 commit comments

Comments
 (0)