configuration.rst 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468
  1. .. raw:: html
  2. <div id="banner"><a href="https://github.com/jcbrand/converse.js/blob/master/docs/source/configuration.rst">Edit me on GitHub</a></div>
  3. =============
  4. Configuration
  5. =============
  6. The included minified JS and CSS files can be used for demoing or testing, but
  7. you'll want to configure *Converse.js* to suit your needs before you deploy it
  8. on your website.
  9. *Converse.js* is passed its configuration settings when you call its *initialize* method.
  10. You'll most likely want to call the *initialize* method in your HTML page. For
  11. an example of how this is done, please see the bottom of the *./index.html* page.
  12. Please refer to the `Configuration settings`_ section below for info on
  13. all the available configuration settings.
  14. After you have configured *Converse.js*, you'll have to regenerate the minified
  15. JS file so that it will include the new settings. Please refer to the
  16. :ref:`minification` section for more info on how to do this.
  17. .. _`configuration-settings`:
  18. Configuration settings
  19. ======================
  20. authentication
  21. --------------
  22. * Default: ``login``
  23. * Allowed values: `login`_, `external`, `anonymous`_, `prebind`_
  24. This option states the way converse.js will authenticate.
  25. login
  26. ~~~~~
  27. The default means is ``login``, which means that the user either logs in manually with their
  28. username and password, or automatically if used together with ``auto_login=true``
  29. and ``jid`` and ``password`` values. See `auto_login`_.
  30. external
  31. ~~~~~~~~
  32. This setting will still show a login form and submit button, but the form will
  33. only contain an input for the user's JID, *not* for the password.
  34. That's because this setting is intended to be used when you are using
  35. SASL-EXTERNAL as authentication mechanism, in which case a password is usually
  36. not required.
  37. SASL-EXTERNAL is generally used together with x509 client certificates to
  38. enable passwordless login or 2-factor authentication.
  39. For more details on this, `read this blog post <https://opkode.com/blog/strophe_converse_sasl_external/>`_.
  40. anonymous
  41. ~~~~~~~~~
  42. This enables anonymous login if the XMPP server supports it. This option can be
  43. used together with `auto_login`_ to automatically and anonymously log a user in
  44. as soon as the page loads.
  45. The server's domain is passed in via the `jid`_ setting.
  46. prebind
  47. ~~~~~~~
  48. See also: :ref:`session-support`
  49. Use this option when you want to attach to an existing XMPP
  50. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  51. Usually a BOSH session is set up server-side in your web app.
  52. Attaching to an existing BOSH session that was set up server-side is useful
  53. when you want to maintain a persistent single session for your users instead of
  54. requiring them to log in manually.
  55. When a BOSH session is initially created, you'll receive three tokens.
  56. A JID (jabber ID), SID (session ID) and RID (Request ID).
  57. Converse.js needs these tokens in order to attach to that same session.
  58. There are two complementary configuration settings to ``prebind``.
  59. They are :ref:`keepalive` and `prebind_url`_.
  60. ``keepalive`` can be used keep the session alive without having to pass in
  61. new RID and SID tokens to ``converse.initialize`` every time you reload the page.
  62. This removes the need to set up a new BOSH session every time a page loads.
  63. You do however still need to supply the user's JID so that converse.js can be
  64. sure that the session it's resuming is for the right user.
  65. `prebind_url`_ lets you specify a URL which converse.js will call whenever a
  66. new BOSH session needs to be set up.
  67. Here's an example of converse.js being initialized with these three options:
  68. .. code-block:: javascript
  69. converse.initialize({
  70. bosh_service_url: 'https://bind.example.com',
  71. keepalive: true,
  72. jid: 'me@example.com',
  73. authentication: 'prebind',
  74. prebind_url: 'http://example.com/api/prebind',
  75. allow_logout: false
  76. });
  77. allow_bookmarks
  78. ---------------
  79. * Default: ``true``
  80. Enables/disables chatroom bookmarks functionality.
  81. This setting is only applicable if the ``converse-bookmarks`` plugin is loaded.
  82. allow_chat_pending_contacts
  83. ---------------------------
  84. * Default: ``false``
  85. Allow the user to chat with pending contacts.
  86. allow_contact_removal
  87. ---------------------
  88. * Default: ``true``
  89. Allow the user to remove roster contacts by clicking on the delete icon
  90. (i.e. traschcan) next to a contact's name in the roster.
  91. allow_contact_requests
  92. ----------------------
  93. * Default: ``true``
  94. Allow users to add one another as contacts. If this is set to false, the
  95. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  96. sections will all not appear. Additionally, all incoming contact requests will be
  97. ignored.
  98. allow_dragresize
  99. ----------------
  100. * Default: ``true``
  101. Allow users to resize chats by dragging the edges. The min-height and min-width
  102. CSS properties set on a chat boxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
  103. will be honored, IF they are set in pixels.
  104. allow_muc
  105. ---------
  106. * Default: ``true``
  107. Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
  108. the ``Chatrooms`` tab from the control box.
  109. allow_muc_invitations
  110. ---------------------
  111. * Default: ``true``
  112. Allows users to be invited to join MUC chat rooms. An "Invite" widget will
  113. appear in the sidebar of the chat room where you can type in the JID of a user
  114. to invite into the chat room.
  115. .. _`allow_non_roster_messaging`:
  116. allow_non_roster_messaging
  117. --------------------------
  118. * Default: ``false``
  119. Determines whether you'll receive messages from users that are not in your
  120. roster. The XMPP specification allows for this (similar to email).
  121. Setting this to `true` increases your chances of receiving spam (when using a
  122. federated server), while setting it to `false` means that people not on your
  123. roster can't contact you unless one (or both) of you subscribe to one another's
  124. presence (i.e. adding as a roster contact).
  125. allow_otr
  126. ---------
  127. * Default: ``true``
  128. Allow Off-the-record encryption of single-user chat messages.
  129. allow_registration
  130. ------------------
  131. * Default: ``true``
  132. Support for `XEP-0077: In band registration <http://xmpp.org/extensions/xep-0077.html>`_
  133. Allow XMPP account registration showing the corresponding UI register form interface.
  134. animate
  135. -------
  136. * Default: ``true``
  137. Show animations, for example when opening and closing chat boxes.
  138. archived_messages_page_size
  139. ---------------------------
  140. * Default: ``50``
  141. See also: `message_archiving`_
  142. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  143. and will only take effect if your server supports MAM.
  144. It allows you to specify the maximum amount of archived messages to be returned per query.
  145. When you open a chat box or room, archived messages will be displayed (if
  146. available) and the amount returned will be no more than the page size.
  147. You will be able to query for even older messages by scrolling upwards in the chat box or room
  148. (the so-called infinite scrolling pattern).
  149. auto_list_rooms
  150. ---------------
  151. * Default: ``false``
  152. If true, and the XMPP server on which the current user is logged in supports
  153. multi-user chat, then a list of rooms on that server will be fetched.
  154. Not recommended for servers with lots of chat rooms.
  155. For each room on the server a query is made to fetch further details (e.g.
  156. features, number of occupants etc.), so on servers with many rooms this
  157. option will create lots of extra connection traffic.
  158. .. _`auto_login`:
  159. auto_login
  160. ----------
  161. * Default: ``false``
  162. This option can be used to let converse.js automatically log the user in as
  163. soon as the page loads.
  164. It should be used either with ``authentication`` set to ``anonymous`` or to ``login``.
  165. If ``authentication`` is set to ``login``, then you will also need to provide a
  166. valid ``jid`` and ``password`` values, either manually by passing them in, or
  167. by the `credentials_url`_ setting. Setting a ``credentials_url`` is preferable
  168. to manually passing in ``jid`` and ``password`` values, because it allows
  169. better reconnection with ``auto_reconnect``. When the connection drops,
  170. converse.js will automatically fetch new login credentials from the
  171. ``credentials_url`` and reconnect.
  172. If ``authentication`` is set to ``anonymous``, then you will also need to provide the
  173. server's domain via the `jid`_ setting.
  174. This is a useful setting if you'd like to create a custom login form in your
  175. website. You'll need to write some JavaScript to accept that custom form's
  176. login credentials, then you can pass those credentials (``jid`` and
  177. ``password``) to ``converse.initialize`` to start converse.js and log the user
  178. into their XMPP account.
  179. auto_away
  180. ---------
  181. * Default: ``0``
  182. The amount of seconds after which the user's presence status should
  183. automatically become ``away``.
  184. If the user's status is ``extended away``, it won't be changed to ``away``.
  185. If the given value is negative or ``0``, this option is disabled.
  186. auto_xa
  187. -------
  188. * Default: ``0``
  189. The amount of seconds after which the user's presence status should
  190. automatically become ``extended away``.
  191. If the value is negative or ``0``, the function is disabled.
  192. auto_reconnect
  193. --------------
  194. * Default: ``false``
  195. Automatically reconnect to the XMPP server if the connection drops
  196. unexpectedly.
  197. This option works best when you have `authentication` set to `prebind` and have
  198. also specified a `prebind_url` URL, from where converse.js can fetch the BOSH
  199. tokens. In this case, converse.js will automaticallly reconnect when the
  200. connection drops but also reestablish earlier lost connections (due to
  201. network outages, closing your laptop etc.).
  202. When `authentication` is set to `login`, then this option will only work when
  203. the page hasn't been reloaded yet, because then the user's password has been
  204. wiped from memory. This configuration can however still be useful when using
  205. converse.js in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  206. or `electron <http://electron.atom.io/>`_.
  207. auto_subscribe
  208. --------------
  209. * Default: ``false``
  210. If true, the user will automatically subscribe back to any contact requests.
  211. auto_join_on_invite
  212. -------------------
  213. * Default: ``false``
  214. If true, the user will automatically join a chatroom on invite without any confirm.
  215. auto_join_rooms
  216. ---------------
  217. * Default: ``[]``
  218. This settings allows you to provide a list of groupchat conversations to be
  219. automatically joined once the user has logged in.
  220. You can either specify a simple list of room JIDs, in which case your nickname
  221. will be taken from your JID, or you can specify a list of maps, where each map
  222. specifies the room's JID and the nickname that should be used.
  223. For example::
  224. `[{'jid': 'room@example.org', 'nick': 'WizardKing69' }]`
  225. .. _`bosh-service-url`:
  226. bosh_service_url
  227. ----------------
  228. * Default: ``undefined``
  229. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  230. connection manager which acts as a middle man between the HTTP and XMPP
  231. protocols.
  232. The bosh_service_url setting takes the URL of a BOSH connection manager.
  233. Please refer to your XMPP server's documentation on how to enable BOSH.
  234. For more information, read this blog post: `Which BOSH server do you need? <http://metajack.im/2008/09/08/which-bosh-server-do-you-need>`_
  235. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  236. Please see the :ref:`websocket-url` configuration setting.
  237. cache_otr_key
  238. -------------
  239. * Default: ``false``
  240. Let the `OTR (Off-the-record encryption) <https://otr.cypherpunks.ca>`_ private
  241. key be cached in your browser's session storage.
  242. The browser's session storage persists across page loads but is deleted once
  243. the tab or window is closed.
  244. If this option is set to ``false``, a new OTR private key will be generated
  245. for each page load. While more inconvenient, this is a much more secure option.
  246. This setting can only be used together with ``allow_otr = true``.
  247. .. note::
  248. A browser window's session storage is accessible by all javascript that
  249. is served from the same domain. So if there is malicious javascript served by
  250. the same server (or somehow injected via an attacker), then they will be able
  251. to retrieve your private key and read your all the chat messages in your
  252. current session. Previous sessions however cannot be decrypted.
  253. chatstate_notification_blacklist
  254. --------------------------------
  255. * Default: ``[]``
  256. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  257. Some user's clients routinely connect and disconnect (likely on mobile) and
  258. each time a chat state notificaion is received (``online`` when connecting and
  259. then ``offline`` when disconnecting).
  260. When desktop notifications are turned on (see `show-desktop-notifications`_),
  261. then you'll receive notification messages each time this happens.
  262. Receiving constant notifications that a user's client is connecting and disconnecting
  263. is annoying, so this option allows you to ignore those JIDs.
  264. connection_options
  265. ------------------
  266. * Default: ``{}``
  267. * Type: Object
  268. Converse.js relies on `Strophe.js <http://strophe.im>`_ to establish and
  269. maintain a connection to the XMPP server.
  270. This option allows you to pass a map of configuration options to be passed into
  271. the ``Strophe.Connection`` constructor.
  272. For documentation on the configuration options that ``Strophe.Connection``
  273. accepts, refer to the
  274. `Strophe.Connection documentation <http://strophe.im/strophejs/doc/1.2.8/files/strophe-js.html#Strophe.Connection.Strophe.Connection>`_.
  275. As an example, suppose you want to restrict the supported SASL authentication
  276. mechanisms, then you'd pass in the ``mechanisms`` as a ``connection_options``
  277. ``key:value`` pair:
  278. .. code-block:: javascript
  279. converse.initialize({
  280. connection_options: {
  281. 'mechanisms': [
  282. converse.env.Strophe.SASLMD5,
  283. ]
  284. },
  285. });
  286. .. _`credentials_url`:
  287. credentials_url
  288. ---------------
  289. * Default: ``null``
  290. * Type: URL
  291. This setting should be used in conjunction with ``authentication`` set to ``login`` and :ref:`keepalive` set to ``true``.
  292. It allows you to specify a URL which converse.js will call when it needs to get
  293. the username and password (or authentication token) which converse.js will use
  294. to automatically log the user in.
  295. If ``auto_reconnect`` is also set to true, then converse.js will automatically
  296. fetch new credentials from the ``credentials_url`` whenever the connection or
  297. session drops, and then attempt to reconnect and establish a new session.
  298. The server behind ``credentials_url`` should return a JSON encoded object::
  299. {
  300. "jid": "me@example.com/resource",
  301. "password": "Ilikecats!",
  302. }
  303. csi_waiting_time
  304. ----------------
  305. * Default: ``0``
  306. This option adds support for `XEP-0352 Client State Indication <http://xmpp.org/extensions/xep-0352.html>_`
  307. If converse.js is idle for the configured amount of seconds, a chat state
  308. indication of ``inactive`` will be sent out to the XMPP server (if the server
  309. supports CSI).
  310. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  311. a chat state indication of ``active`` will be sent out.
  312. A value of ``0`` means that this feature is disabled.
  313. debug
  314. -----
  315. * Default: ``false``
  316. If set to true, debugging output will be logged to the browser console.
  317. default_domain
  318. --------------
  319. * Default: ``undefined``
  320. Specify a domain to act as the default for user JIDs. This allows users to log
  321. in with only the username part of their JID, instead of the full JID.
  322. For example, if ``default_domain`` is ``example.org``, then the user
  323. ``johnny@example.org`` can log in with only ``johnny``.
  324. JIDs with other domains are still allowed but need to be provided in full.
  325. To specify only one domain and disallow other domains, see the `locked_domain`_
  326. option.
  327. registration_domain
  328. -------------------
  329. * Default: ``''``
  330. Specify a domain name for which the registration form will be fetched automatically,
  331. without the user having to enter any XMPP server domain name.
  332. default_state
  333. -------------
  334. * Default: ``'online'``
  335. The default chat status that the user wil have. If you for example set this to
  336. ``'chat'``, then converse.js will send out a presence stanza with ``"show"``
  337. set to ``'chat'`` as soon as you've been logged in.
  338. domain_placeholder
  339. ------------------
  340. * Default: ``e.g. conversejs.org``
  341. The placeholder text shown in the domain input on the registration form.
  342. emojione_image_path
  343. -------------------
  344. * Default: ``'https://cdn.jsdelivr.net/emojione/assets/' + emojioneVersion + '/png/'``
  345. When `use_emojione`_ is set to ``true``, then this is the URL from where PNG image files for
  346. displaying emojis will be fetched.
  347. expose_rid_and_sid
  348. ------------------
  349. * Default: ``false``
  350. Allow the prebind tokens, RID (request ID) and SID (session ID), to be exposed
  351. globally via the API. This allows other scripts served on the same page to use
  352. these values.
  353. *Beware*: a malicious script could use these tokens to assume your identity
  354. and inject fake chat messages.
  355. filter_by_resource
  356. ------------------
  357. * Default: ``false``
  358. Before version 1.0.3 converse.js would ignore received messages if they were
  359. intended for a different resource then the current user had. It was decided to
  360. drop this restriction but leave it configurable.
  361. forward_messages
  362. ----------------
  363. * Default: ``false``
  364. If set to ``true``, sent messages will also be forwarded to the sending user's
  365. bare JID (their Jabber ID independent of any chat clients aka resources).
  366. This means that sent messages are visible from all the user's chat clients,
  367. and not just the one from which it was actually sent.
  368. This is especially important for web chat, such as converse.js, where each
  369. browser tab functions as a separate chat client, with its own resource.
  370. This feature uses Stanza forwarding, see also `XEP 0297: Stanza Forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  371. For an alternative approach, see also `message_carbons`_.
  372. fullname
  373. --------
  374. If you are using prebinding, can specify the fullname of the currently
  375. logged in user, otherwise the user's vCard will be fetched.
  376. .. _`hide_muc_server`:
  377. hide_muc_server
  378. ---------------
  379. * Default: ``false``
  380. Hide the ``server`` input field of the form inside the ``Room`` panel of the
  381. controlbox. Useful if you want to restrict users to a specific XMPP server of
  382. your choosing.
  383. hide_offline_users
  384. ------------------
  385. * Default: ``false``
  386. If set to ``true``, then don't show offline users.
  387. hide_open_bookmarks
  388. -------------------
  389. * Default: ``false`` (``true`` for inVerse).
  390. This setting applies to the ``converse-bookmarks`` plugin and specfically the
  391. list of bookmarks shown in the ``Rooms`` tab of the control box.
  392. By default all bookmarks are shown in that list, if this setting is set to
  393. ``true``, then only bookmarks for rooms not currently open (i.e. that the
  394. current user hasn't joined), are shown.
  395. Makes sense to set this to ``true`` when also using the non-core
  396. ``converse-roomslist`` plugin, which shows a list of currently open (i.e.
  397. "joined") rooms.
  398. include_offline_state
  399. ---------------------
  400. * Default: `false`
  401. Originally, converse.js included an `offline` state which the user could
  402. choose (along with `online`, `busy` and `away`).
  403. Eventually it was however decided to remove this state, since the `offline`
  404. state doesn't propagate across tabs like the others do.
  405. What's meant by "propagate across tabs", is that when you set the state to
  406. `offline` in one tab, and you have instances of converse.js open in other tabs
  407. in your browser, then those instances will not have their states changed to
  408. `offline` as well. For the other statees the change is however propagated.
  409. The reason for this is that according to the XMPP spec, there is no `offline`
  410. state. The only defined states are:
  411. * away -- The entity or resource is temporarily away.
  412. * chat -- The entity or resource is actively interested in chattiIng.
  413. * dnd -- The entity or resource is busy (dnd = "Do Not Disturb").
  414. * xa -- The entity or resource is away for an extended period (xa = "eXtended Away").
  415. Read the `relevant section in the XMPP spec <https://xmpp.org/rfcs/rfc6121.html#presence-syntax-children-show>`_
  416. for more info.
  417. What used to happen in converse.js when the `offline` state was chosen, is
  418. that a presence stanza with a `type` of `unavailable` was sent out.
  419. This is actually exactly what happens when you log out of converse.js as well,
  420. with the notable exception that in the `offline` state, the connection is not
  421. terminated. So you can at any time change your state to something else and
  422. start chatting again.
  423. This might be useful to people, however the fact that the `offline` state
  424. doesn't propagate across tabs means that the user experience is inconsistent,
  425. confusing and appears "broken".
  426. If you are however aware of this issue and still want to allow the `offline`
  427. state, then you can set this option to `true` to enable it.
  428. .. _`i18n`:
  429. i18n
  430. ----
  431. * Default: Auto-detection of the User/Browser language or ``en``;
  432. Specify the locale/language.
  433. The translations for that locale must be available in JSON format at the
  434. `locales_url`_
  435. If an explicit locale is specified via the ``i18n`` setting and the
  436. translations for that locale are not found at the `locales_url``, then
  437. then Converse.js will fall back to trying to determine the browser's language
  438. and fetching those translations, or if that fails the default English texts
  439. will be used.
  440. jid
  441. ---
  442. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  443. on the XMPP network. It looks like an email address, but it's used for instant
  444. messaging instead.
  445. This value needs to be provided when using the :ref:`keepalive` option together
  446. with `prebind`_.
  447. .. _`keepalive`:
  448. keepalive
  449. ---------
  450. * Default: ``true``
  451. Determines whether Converse.js will maintain the chat session across page
  452. loads.
  453. This setting should also be used in conjunction with ``authentication`` set to `prebind`_.
  454. When using ``keepalive`` and ``prebind``, you will have to provide the `jid`_
  455. of the current user to ensure that a cached session is only resumed if it
  456. belongs to the current user.
  457. See also:
  458. * :ref:`session-support`
  459. .. note::
  460. Currently the "keepalive" setting only works with BOSH and not with
  461. websockets. This is because XMPP over websocket does not use the same
  462. session token as with BOSH. A possible solution for this is to implement
  463. `XEP-0198 <http://xmpp.org/extensions/xep-0198.html>`_, specifically
  464. with regards to "stream resumption".
  465. .. _`locales`:
  466. locales
  467. -------
  468. * Default:
  469. .. code-block:: javascript
  470. locales: [
  471. 'af', 'ca', 'de',
  472. 'es', 'en', 'fr',
  473. 'he', 'hu', 'id',
  474. 'it', 'ja', 'nb',
  475. 'nl', 'pl', 'pt_BR',
  476. 'ru', 'uk', 'zh'
  477. ]
  478. This setting restricts the locales that are supported by Converse.js and
  479. therefore what may be given as value for the :ref:`i18n` option.
  480. Any other locales will be ignored.
  481. When self-hosting, also make sure that the locales are served and therefore
  482. fetchable (via ``XMLHttpRequest``) at the URL specified by :ref:`locales-url`.
  483. .. _`locales-url`:
  484. locales_url
  485. -----------
  486. * Default: ``/locale/{{{locale}}}/LC_MESSAGES/converse.json``,
  487. The URL from where Converse.js should fetch translation JSON.
  488. The three curly braces ``{{{ }}}`` are
  489. `Mustache <https://github.com/janl/mustache.js#readme>`_-style
  490. variable interpolation which HTML-escapes the value being inserted. It's
  491. important that the inserted value is HTML-escaped, otherwise a malicious script
  492. injection attack could be attempted.
  493. The variable being interpolated via the curly braces is ``locale``, which is
  494. the value passed in to the `i18n`_ setting, or the browser's locale or the
  495. default local or `en` (resolved in that order).
  496. From version 3.3.0, Converse.js no longer bundles all translations into its
  497. final build file. Instead, only the relevant translations are fetched at
  498. runtime.
  499. This change also means that it's no longer possible to pass in the translation
  500. JSON data directly into ``_converse.initialize`` via the `i18n`_ setting.
  501. Instead, you only specify the language code (e.g. `de`) and that language's
  502. JSON translations will automatically be fetched via XMLHTTPRequest at
  503. ``locales_url``.
  504. locked_domain
  505. -------------
  506. * Default: ``undefined``
  507. Similar to `default_domain`_ but no other domains are allowed.
  508. For example, if ``locked_domain`` is set to ``example.org``, then the user
  509. ``johnny@example.org`` can log in with only ``johnny``.
  510. Additionally, only users registered on the ``example.org`` host can log in, no
  511. other users are allowed to log in.
  512. message_archiving
  513. -----------------
  514. * Default: ``undefined``
  515. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  516. whereby messages are archived in the XMPP server for later retrieval.
  517. Note, your XMPP server must support XEP-0313 MAM for this to work.
  518. This option sets the default archiving preference.
  519. Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
  520. ``undefined`` means that any existing MAM configuration, as set by the user or
  521. the server administrator, will be used.
  522. ``roster`` means that only messages to and from JIDs in your roster will be
  523. archived. The other two values are self-explanatory.
  524. message_archiving_timeout
  525. -------------------------
  526. * Default: ``8000``
  527. The amount of time (in milliseconds) to wait when requesting archived messages
  528. from the XMPP server.
  529. Used in conjunction with `message_archiving` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  530. message_carbons
  531. ---------------
  532. * Default: ``false``
  533. Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>`_
  534. In order to keep all IM clients for a user engaged in a conversation,
  535. outbound messages are carbon-copied to all interested resources.
  536. This is especially important in webchat, like converse.js, where each browser
  537. tab serves as a separate IM client.
  538. Both message_carbons and `forward_messages`_ try to solve the same problem
  539. (showing sent messages in all connected chat clients aka resources), but go about it
  540. in two different ways.
  541. Message carbons is the XEP (Jabber protocol extension) specifically drafted to
  542. solve this problem, while `forward_messages`_ uses
  543. `stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  544. message_storage
  545. ----------------
  546. * Default: ``session``
  547. Valid options: ``session``, ``local``.
  548. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  549. (``localStorage`` or ``sessionStorage``) used by converse.js to cache messages (private and group).
  550. The main difference between the two is that `sessionStorage` only persists while
  551. the current tab or window containing a converse.js instance is open. As soon as
  552. it's closed, the data is cleared.
  553. Data in `localStorage` on the other hand is kept indefinitely, which can have
  554. privacy implications on public computers or when multiple people are using the
  555. same computer.
  556. See also the `storage`_ option, which applies to other cached data, such as
  557. which chats you have open, what features the XMPP server supports and what
  558. your online status is.
  559. muc_disable_moderator_commands
  560. ------------------------------
  561. * Default: ``false``
  562. Allows you to disable the moderator commands such as ``/kick`` or ``/ban``.
  563. muc_domain
  564. ----------
  565. * Default: ``undefined``
  566. The MUC (multi-user chat) domain that should be used. By default converse.js
  567. will attempt to get the MUC domain from the XMPP host of the currently logged in
  568. user.
  569. This setting will override that. You might want to combine this setting with `hide_muc_server`_.
  570. muc_history_max_stanzas
  571. -----------------------
  572. * Default: ``undefined``
  573. This option allows you to specify the maximum amount of messages to be shown in a
  574. chat room when you enter it. By default, the amount specified in the room
  575. configuration or determined by the server will be returned.
  576. Please note, this option is not related to
  577. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  578. which also allows you to show archived chat room messages, but follows a
  579. different approach.
  580. If you're using MAM for archiving chat room messages, you might want to set
  581. this option to zero.
  582. muc_instant_rooms
  583. ------------------
  584. * Default: ``true``
  585. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  586. Otherwise rooms first have to be configured before they're available to other
  587. users (so-called "registered rooms" in `MUC-0045 <http://xmpp.org/extensions/xep-0045.html#createroom>`_).
  588. From a UX perspective, if this settings is `false`, then a configuration form will
  589. render, that has to be filled in first, before the room can be joined by other
  590. users.
  591. muc_nickname_from_jid
  592. ---------------------
  593. * Default: ``false``
  594. When set to ``true``, then users will not be prompted to provide nicknames for
  595. chat rooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  596. will be used. If the user's nickname is already taken by another user in the
  597. chat room, then an integer will be added to make it unique.
  598. So, for example, if john@example.com joins a chatroom, his nickname will
  599. automatically be "john". If now john@differentdomain.com tries to join the
  600. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  601. his nickname will be "john-3", and so forth.
  602. muc_show_join_leave
  603. -------------------
  604. * Default; ``true``
  605. Determines whether Converse.js will show info messages inside a chat room
  606. whenever a user joins or leaves it.
  607. notify_all_room_messages
  608. ------------------------
  609. * Default: ``false``
  610. By default, sound and desktop notifications will only be made when you are
  611. mentioned in a room. If you set this setting to `true`, then you will be
  612. notified of all messages received in a room.
  613. You can also pass an array of room JIDs to this option, to only apply it to
  614. certain rooms.
  615. notification_icon
  616. -----------------
  617. * Default: ``'/logo/conversejs.png'``
  618. This option specifies which icon is shown in HTML5 notifications, as provided
  619. by the ``src/converse-notification.js`` plugin.
  620. ping_interval
  621. -------------
  622. * Default: ``180``
  623. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  624. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  625. You need to set the value to any positive value to enable this functionality.
  626. If you set this value to ``0`` or any negative value, il will disable this functionality.
  627. .. _`play-sounds`:
  628. play_sounds
  629. -----------
  630. * Default: ``false``
  631. Plays a notification sound when you receive a personal message or when your
  632. nickname is mentioned in a chat room.
  633. Inside the ``./sounds`` directory of the Converse.js repo you'll see MP3 and Ogg
  634. formatted sound files. We need both, because neither format is supported by all browsers.
  635. You can set the URL where the sound files are hosted with the `sounds_path`_
  636. option.
  637. Requires the `src/converse-notification.js` plugin.
  638. .. _`prebind_url`:
  639. prebind_url
  640. -----------
  641. * Default: ``null``
  642. * Type: URL
  643. See also: :ref:`session-support`
  644. This setting should be used in conjunction with ``authentication`` set to `prebind` and :ref:`keepalive` set to ``true``.
  645. It allows you to specify a URL which converse.js will call when it needs to get
  646. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  647. converse.js will then attach to.
  648. The server behind ``prebind_url`` should return a JSON encoded object with the
  649. three tokens::
  650. {
  651. "jid": "me@example.com/resource",
  652. "sid": "346234623462",
  653. "rid": "876987608760"
  654. }
  655. priority
  656. --------
  657. * Default: ``0``
  658. * Type: Number
  659. Determines the priority used for presence stanzas sent out from this resource
  660. (i.e. this instance of Converse.js).
  661. The priority of a given XMPP chat client determines the importance of its presence
  662. stanzas in relation to stanzas received from other clients of the same user.
  663. In Converse.js, the indicated chat status of a roster contact will be taken from the
  664. presence stanza (and associated resource) with the highest priority.
  665. If multiple resources have the same top priority, then the chat status will be
  666. taken from the most recent present stanza.
  667. For more info you can read `Section 2.2.2.3 of RFC-3921 <https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.3>`_.
  668. providers_link
  669. --------------
  670. * Default: ``https://xmpp.net/directory.php``
  671. The hyperlink on the registration form which points to a directory of public
  672. XMPP servers.
  673. roster_groups
  674. -------------
  675. * Default: ``false``
  676. If set to ``true``, converse.js will show any roster groups you might have
  677. configured.
  678. .. note::
  679. It's currently not possible to use converse.js to assign contacts to groups.
  680. Converse.js can only show users and groups that were previously configured
  681. elsewhere.
  682. show_chatstate_notifications
  683. ----------------------------
  684. * Default: ``false``
  685. Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
  686. show_controlbox_by_default
  687. --------------------------
  688. * Default: ``false`` (``true`` for inVerse)
  689. The "controlbox" refers to the special chatbox containing your contacts roster,
  690. status widget, chatrooms and other controls.
  691. By default this box is hidden and can be toggled by clicking on any element in
  692. the page with class *toggle-controlbox*.
  693. If this options is set to true, the controlbox will by default be shown upon
  694. page load.
  695. However, be aware that even if this value is set to ``false``, if the
  696. controlbox is open, and the page is reloaded, then it will stay open on the new
  697. page as well.
  698. .. _`show-desktop-notifications`:
  699. show_desktop_notifications
  700. --------------------------
  701. * Default: ``true``
  702. Should HTML5 desktop notifications be shown?
  703. Notification will be shown in the following cases:
  704. * the browser is not visible nor focused and a private message is received.
  705. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  706. * `auto_subscribe` is set to `false` and a new contact request is received.
  707. Requires the `src/converse-notification.js` plugin.
  708. use_emojione
  709. ------------
  710. * Default: ``true``
  711. Determines whether `Emojione <https://www.emojione.com/>`_ should be used to
  712. render emojis. If set to ``false``, then rendering support will fall back to
  713. the operating system or browser (which might not support emoji).
  714. See also `emojione_image_path`_.
  715. show_only_online_users
  716. ----------------------
  717. * Default: ``false``
  718. If set to ``true``, only online users will be shown in the contacts roster.
  719. Users with any other status (e.g. away, busy etc.) will not be shown.
  720. show_send_button
  721. ----------------------
  722. * Default: ``false``
  723. If set to ``true``, a button will be visible which can be clicked to send a message.
  724. sounds_path
  725. -----------
  726. * Default: ``/sounds/``
  727. This option only makes sense in conjunction with the `play_sounds`_ option and
  728. specifies the URL of the sound files to be played (exluding the file names
  729. themselves).
  730. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  731. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  732. storage
  733. -------
  734. * Default: ``session``
  735. Valid options: ``session``, ``local``.
  736. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  737. (``localStorage`` or ``sessionStorage``) used by converse.js to cache user data.
  738. Originally converse.js used only `localStorage`, however `sessionStorage` is from a
  739. privacy perspective a better choice.
  740. The main difference between the two is that `sessionStorage` only persists while
  741. the current tab or window containing a converse.js instance is open. As soon as
  742. it's closed, the data is cleared.
  743. Data in `localStorage` on the other hand is kept indefinitely.
  744. The data that is cached includes which chats you had open, what features the
  745. XMPP server supports and what your online status was.
  746. Since version 1.0.7, the store for messages is now configurable separately with
  747. the `message_storage`_ option, to allow you to cache messages for longer in the
  748. browser (with `localStorage`) while still using `sessionStorage` for other
  749. data.
  750. .. note::
  751. Between versions 0.8.0 and 1.0.7, setting the value of this option to "local"
  752. is not recommended. The statuses (online, away, busy etc.) of your roster
  753. contacts are cached in the browser storage. If you use local storage, these
  754. values are stored for multiple sessions, and they will likely become out of
  755. sync with your contacts' actual statuses. The session storage doesn't have
  756. this problem, because roster contact statuses will not become out of sync in
  757. a single session, only across more than one session.
  758. Since version 1.0.7, the "storage" option doesn't apply anymore to how roster
  759. contacts and their statuses are stored (they're now always stored in session
  760. storage), to address the above issue.
  761. sticky_controlbox
  762. -----------------
  763. * Default: ``false`` (``true`` for inVerse).
  764. If set to ``true``, the control box (which includes the login, registration,
  765. contacts and rooms tabs) will not be closeable. It won't have a close button at
  766. all.
  767. The idea behind this setting is to provide a better experience on mobile
  768. devices when the intent is to use converse.js as a web app. In this case
  769. it doesn't make sense to close the control box, as there's often then nothing
  770. "behind" it that's relevant to the user.
  771. .. _`strict_plugin_dependencies`:
  772. strict_plugin_dependencies
  773. --------------------------
  774. * Default: ``false``
  775. When set to ``true`` and a plugin tries to override an object which doesn't
  776. exist (for example because the plugin which provides that object is not
  777. loaded), then an error will be raised.
  778. Otherwise a message will simply be logged and the override instruction ignored.
  779. The Converse.js plugins architecture can have an :ref:`optional_dependencies`
  780. plugin attribute. This enables you to specify an array of optional, or
  781. "soft", dependencies. Converse.js (more specifically,
  782. `pluggable.js <https://jcbrand.github.io/pluggable.js/>`_) will try to first
  783. load the optional dependencies before executing the plugin's overrides and
  784. calling its ``initialize`` method.
  785. If ``strict_plugin_dependencies`` is set to ``false`` it won't raise an error
  786. if the optional dependencies aren't found. If set to ``true`` these optional
  787. dependencies are treated as normal non-optional ones, which means that an error
  788. will be raised.
  789. synchronize_availability
  790. ------------------------
  791. * Default: ``true``
  792. Valid options: ``true``, ``false``, ``a resource name``.
  793. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  794. if you change your status to `busy` in a different chat client, your status will change to `busy` in converse.js as well.
  795. If set to ``true``, converse.js will synchronize with all other clients you are logged in with.
  796. If set to ``false``, this feature is disabled.
  797. If set to ``a resource name``, converse.js will synchronize only with a client that has that particular resource assigned to it.
  798. time_format
  799. -----------
  800. * Default: ``HH:mm``
  801. Examples: ``HH:mm``, ``hh:mm``, ``hh:mm a``.
  802. This option makes the time format for the time shown, for each message, configurable. Converse uses `moment.js <https://momentjs.com/>`_
  803. for showing time. This option allows the configuration of the format in which `moment` will display the time for the messages. For detailed
  804. description of time-format options available for `moment` you can check this `link <https://momentjs.com/docs/#/parsing/string-format/>`_.
  805. use_otr_by_default
  806. ------------------
  807. * Default: ``false``
  808. If set to ``true``, Converse.js will automatically try to initiate an OTR (off-the-record)
  809. encrypted chat session every time you open a chat box.
  810. use_vcards
  811. ----------
  812. * Default: ``true``
  813. Determines whether the XMPP server will be queried for roster contacts' VCards
  814. or not. VCards contain extra personal information such as your fullname and
  815. avatar image.
  816. visible_toolbar_buttons
  817. -----------------------
  818. * Default:
  819. .. code-block:: javascript
  820. {
  821. call: false,
  822. clear: true,
  823. emoji: true,
  824. toggle_occupants: true
  825. }
  826. Allows you to show or hide buttons on the chat boxes' toolbars.
  827. * *call*:
  828. Provides a button with a picture of a telephone on it.
  829. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.
  830. .. code-block:: javascript
  831. converse.listen.on('callButtonClicked', function(data) {
  832. console.log('Strophe connection is', data.connection);
  833. console.log('Bare buddy JID is', data.model.get('jid'));
  834. // ... Third-party library code ...
  835. });
  836. * *clear*:
  837. Provides a button for clearing messages from a chat box.
  838. * *emoji*:
  839. Enables rendering of emoji and provides a toolbar button for choosing them.
  840. * *toggle_occupants*:
  841. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chat room.
  842. .. _`websocket-url`:
  843. websocket_url
  844. -------------
  845. * Default: ``undefined``
  846. This option is used to specify a
  847. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  848. converse.js can connect to.
  849. Websockets provide a more modern and effective two-way communication protocol
  850. between the browser and a server, effectively emulating TCP at the application
  851. layer and therefore overcoming many of the problems with existing long-polling
  852. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  853. Please refer to your XMPP server's documentation on how to enable websocket
  854. support.
  855. .. note::
  856. Please note that not older browsers do not support websockets. For older
  857. browsers you'll want to specify a BOSH URL. See the :ref:`bosh-service-url`
  858. configuration setting).
  859. .. note::
  860. Converse.js does not yet support "keepalive" with websockets.
  861. blacklisted_plugins
  862. -------------------
  863. * Default: ``[]`` (``['converse-minimize', 'converse-dragresize']`` for inVerse)
  864. A list of plugin names that are blacklisted and will therefore not be
  865. initialized once ``converse.initialize`` is called, even if the same plugin is
  866. whitelisted.
  867. From Converse.js 3.0 onwards most of the API is available only to plugins and
  868. all plugins need to be whitelisted first.
  869. The usecase for blacklisting is generally to disable removed core plugins
  870. (which are automatically whitelisted) to prevent other (potentially malicious)
  871. plugins from registering themselves under those names.
  872. The core, and by default whitelisted, plugins are::
  873. converse-bookmarks
  874. converse-chatview
  875. converse-controlbox
  876. converse-core
  877. converse-dragresize
  878. converse-headline
  879. converse-mam
  880. converse-minimize
  881. converse-muc
  882. converse-notification
  883. converse-otr
  884. converse-ping
  885. converse-register
  886. converse-rosterview
  887. converse-vcard
  888. An example from `the embedded room demo <https://conversejs.org/demo/embedded.html>`_
  889. .. code-block:: javascript
  890. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  891. converse.initialize({
  892. // other settings removed for brevity
  893. blacklisted_plugins: [
  894. 'converse-controlbox',
  895. 'converse-dragresize',
  896. 'converse-minimize',
  897. 'converse-vcard'
  898. ],
  899. });
  900. });
  901. .. _`whitelisted_plugins`:
  902. whitelisted_plugins
  903. -------------------
  904. * Default: ``[]``
  905. A list of plugin names that are whitelisted and will therefore be
  906. initialized once ``converse.initialize`` is called.
  907. From Converse.js 3.0 onwards most of the API is available only to plugins and
  908. all plugins need to be whitelisted first.
  909. This is done to prevent malicious scripts from using the API to trick users or
  910. to read their conversations.
  911. By default all the core plugins are already whitelisted.
  912. These are::
  913. converse-bookmarks
  914. converse-chatview
  915. converse-controlbox
  916. converse-core
  917. converse-dragresize
  918. converse-headline
  919. converse-mam
  920. converse-minimize
  921. converse-muc
  922. converse-notification
  923. converse-otr
  924. converse-ping
  925. converse-register
  926. converse-rosterview
  927. converse-vcard
  928. If you are using a custom build which excludes some core plugins, then you
  929. should blacklist them so that malicious scripts can't register their own
  930. plugins under those names. See `blacklisted_plugins`_ for more info.
  931. An example from `the embedded room demo <https://conversejs.org/demo/embedded.html>`_
  932. .. code-block:: javascript
  933. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  934. converse.initialize({
  935. // other settings removed for brevity
  936. whitelisted_plugins: ['converse-muc-embedded']
  937. });
  938. });
  939. xhr_custom_status
  940. -----------------
  941. * Default: ``false``
  942. .. note::
  943. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  944. This option will let converse.js make an AJAX POST with your changed custom chat status to a
  945. remote server.
  946. xhr_custom_status_url
  947. ---------------------
  948. .. note::
  949. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  950. * Default: Empty string
  951. Used only in conjunction with ``xhr_custom_status``.
  952. This is the URL to which the AJAX POST request to set the user's custom status
  953. message will be made.
  954. The message itself is sent in the request under the key ``msg``.
  955. xhr_user_search
  956. ---------------
  957. * Default: ``false``
  958. .. note::
  959. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  960. There are two ways to add users.
  961. * The user inputs a valid JID (Jabber ID), and the user is added as a pending contact.
  962. * The user inputs some text (for example part of a firstname or lastname), an XHR (Ajax Request) will be made to a remote server, and a list of matches are returned. The user can then choose one of the matches to add as a contact.
  963. This setting enables the second mechanism, otherwise by default the first will be used.
  964. *What is expected from the remote server?*
  965. A default JSON encoded list of objects must be returned. Each object
  966. corresponds to a matched user and needs the keys ``id`` and ``fullname``.
  967. .. code-block:: javascript
  968. [{"id": "foo", "fullname": "Foo McFoo"}, {"id": "bar", "fullname": "Bar McBar"}]
  969. .. note::
  970. Make sure your server script sets the header `Content-Type: application/json`.
  971. xhr_user_search_url
  972. -------------------
  973. .. note::
  974. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  975. * Default: Empty string
  976. Used only in conjunction with ``xhr_user_search``.
  977. This is the URL to which an XHR GET request will be made to fetch user data from your remote server.
  978. The query string will be included in the request with ``q`` as its key.
  979. The data returned must be a JSON encoded list of user JIDs.