configuration.rst 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184
  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 JavaScript and CSS files can be used for demoing or testing, but
  7. you'll want to configure Converse to suit your needs before you deploy it
  8. on your website.
  9. Converse 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. .. _`configuration-settings`:
  15. Configuration settings
  16. ======================
  17. authentication
  18. --------------
  19. * Default: ``login``
  20. * Allowed values: `login`_, `external`, `anonymous`_, `prebind`_
  21. This option states the way Converse will authenticate.
  22. login
  23. ~~~~~
  24. The default means is ``login``, which means that the user either logs in manually with their
  25. username and password, or automatically if used together with `auto_login`_ set to ``true``
  26. and ``jid`` and ``password`` values.
  27. external
  28. ~~~~~~~~
  29. This setting will still show a login form and submit button, but the form will
  30. only contain an input for the user's JID, *not* for the password.
  31. That's because this setting is intended to be used when you are using
  32. SASL-EXTERNAL as authentication mechanism, in which case a password is usually
  33. not required.
  34. SASL-EXTERNAL is generally used together with x509 client certificates to
  35. enable passwordless login or 2-factor authentication.
  36. For more details on this, `read this blog post <https://opkode.com/blog/strophe_converse_sasl_external/>`_.
  37. anonymous
  38. ~~~~~~~~~
  39. This enables anonymous login if the XMPP server supports it. This option can be
  40. used together with `auto_login`_ to automatically and anonymously log a user in
  41. as soon as the page loads.
  42. The server's domain is passed in via the `jid`_ setting.
  43. .. _`prebind`:
  44. prebind
  45. ~~~~~~~
  46. See also: :ref:`session-support`
  47. Use this option when you want to attach to an existing XMPP
  48. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  49. Usually a BOSH session is set up server-side in your web app.
  50. Attaching to an existing BOSH session that was set up server-side is useful
  51. when you want to maintain a persistent single session for your users instead of
  52. requiring them to log in manually.
  53. When a BOSH session is initially created, you'll receive three tokens.
  54. A JID (jabber ID), SID (session ID) and RID (Request ID).
  55. Converse needs these tokens in order to attach to that same session.
  56. In addition to setting `authentication`_ to ``prebind``, you'll also need to
  57. set the `prebind_url`_ and `bosh-service-url`_.
  58. Here's an example of Converse being initialized with these options:
  59. .. code-block:: javascript
  60. converse.initialize({
  61. bosh_service_url: 'https://bind.example.com',
  62. jid: 'me@example.com',
  63. authentication: 'prebind',
  64. prebind_url: 'http://example.com/api/prebind',
  65. auto_login: true,
  66. allow_logout: false
  67. });
  68. allow_adhoc_commands
  69. --------------------
  70. * Default: ``true``
  71. Allows privileged users to run XEP-0050 Ad-Hoc commands via the settings modal.
  72. allow_bookmarks
  73. ---------------
  74. * Default: ``true``
  75. Enables/disables chatroom bookmarks functionality.
  76. This setting is only applicable if the ``converse-bookmarks`` plugin is loaded.
  77. See also: `allow_public_bookmarks`_
  78. allow_chat_pending_contacts
  79. ---------------------------
  80. * Default: ``false``
  81. Allow the user to chat with pending contacts.
  82. allow_contact_removal
  83. ---------------------
  84. * Default: ``true``
  85. Allow the user to remove roster contacts by clicking on the delete icon
  86. (i.e. trashcan) next to a contact's name in the roster.
  87. allow_contact_requests
  88. ----------------------
  89. * Default: ``true``
  90. Allow users to add one another as contacts. If this is set to false, the
  91. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  92. sections will all not appear. Additionally, all incoming contact requests will be
  93. ignored.
  94. allow_dragresize
  95. ----------------
  96. * Default: ``true``
  97. Allow users to resize chats by dragging the edges. The min-height and min-width
  98. CSS properties set on a chatboxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
  99. will be honored, IF they are set in pixels.
  100. allow_logout
  101. ------------
  102. * Default: ``true``
  103. Determines whether the user is allowed to log out. If set to ``false``, there will be no logout button.
  104. .. _`allow_message_corrections`:
  105. allow_message_corrections
  106. -------------------------
  107. * Default: ``'all'``
  108. * Possible values: ``'all'``, ``'last'``
  109. Configures the last message correction (LMC) feature of Converse. By default you can edit all of your own
  110. messages. Setting this to ``'last'`` will limit this feature to the message sent most recently as suggested by
  111. `XEP-0308: Last Message Correction <https://xmpp.org/extensions/xep-0308.html>`_.
  112. Setting it to anything else (including ``false``) will disable the ability to correct sent messages.
  113. allow_message_retraction
  114. ------------------------
  115. * Default: ``'all'``
  116. * Possible values: ``'all'``, ``'own'``, ``'moderator'`` or any falsy value
  117. Determines who is allowed to retract messages. If set to ``'all'``, then normal
  118. users may retract their own messages and ``'moderators'`` may retract the messages of
  119. other users.
  120. allow_muc
  121. ---------
  122. * Default: ``true``
  123. Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
  124. the ``Chatrooms`` tab from the control box.
  125. allow_muc_invitations
  126. ---------------------
  127. * Default: ``true``
  128. Allows users to be invited to join MUC chatrooms. An "Invite" widget will
  129. appear in the sidebar of the chatroom where you can type in the JID of a user
  130. to invite into the chatroom.
  131. .. _`allow_non_roster_messaging`:
  132. allow_non_roster_messaging
  133. --------------------------
  134. * Default: ``false``
  135. Determines whether you'll receive messages from users that are not in your
  136. roster. The XMPP specification allows for this (similar to email).
  137. Setting this to ``true`` increases your chances of receiving spam (when using a
  138. federated server), while setting it to ``false`` means that people not on your
  139. roster can't contact you unless one (or both) of you subscribe to one another's
  140. presence (i.e. adding as a roster contact).
  141. allow_public_bookmarks
  142. ----------------------
  143. * Default: ``false``
  144. Some XMPP servers don't support private PEP/PubSub nodes, as required for
  145. private bookmarks and outlined in `XEP-0223 <https://xmpp.org/extensions/xep-0223.html>`_.
  146. Even though Converse asks for the bookmarks to be kept private (via the
  147. `<publish-options>` XML node), the server simply ignores the privacy settings
  148. and publishes the node contents under the default privacy setting, which makes
  149. the information available to all roster contacts.
  150. If your XMPP server does not support `XEP-0223`'s ``#publish-options``
  151. feature and you don't mind that your room bookmarks are visible to all
  152. contacts, then you can set this setting to ``true``. Otherwise you won't be
  153. able to have any room bookmarks at all for an account on that XMPP server.
  154. allow_registration
  155. ------------------
  156. * Default: ``true``
  157. Support for `XEP-0077: In band registration <https://xmpp.org/extensions/xep-0077.html>`_
  158. Allow XMPP account registration showing the corresponding UI register form interface.
  159. allow_user_trust_override
  160. -------------------------
  161. * Default: ``true``
  162. * Allowed values: ``true``, ``false``, ``off``
  163. This setting determines whether a user may decide whether
  164. Converse is ``trusted`` or not (e.g. in the particular browser).
  165. This is done via a *This is a trusted device* checkbox in the login form.
  166. If this setting is set to ``true`` or ``off``, the checkbox will be shown to the user, otherwise not.
  167. When this setting is set to ``true``, the checkbox will be checked by default.
  168. To not have it checked by default, set this setting to ``off``.
  169. If the user indicates that this device/browser is not trusted, then effectively
  170. it's the same as setting `clear_cache_on_logout`_ to ``true``
  171. and `persistent_store`_ to ``sessionStorage``.
  172. ``sessionStorage`` only persists while the current tab or window containing a Converse instance is open.
  173. As soon as it's closed, the data is cleared.
  174. The data that is cached (or cleared) includes your sent and received messages, which chats you had
  175. open, what features the XMPP server supports and what your online status was.
  176. Clearing the cache makes Converse much slower when the user logs in again, because all data needs to be fetch anew.
  177. archived_messages_page_size
  178. ---------------------------
  179. * Default: ``50``
  180. See also: `message_archiving`_
  181. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  182. and will only take effect if your server supports MAM.
  183. It allows you to specify the maximum amount of archived messages to be returned per query.
  184. When you open a chatbox or room, archived messages will be displayed (if
  185. available) and the amount returned will be no more than the page size.
  186. You will be able to query for even older messages by scrolling upwards in the chatbox or room
  187. (the so-called infinite scrolling pattern).
  188. autocomplete_add_contact
  189. ------------------------
  190. * Default: ``true``
  191. Determines whether search suggestions are shown in the "Add Contact" modal.
  192. auto_focus
  193. ----------
  194. * Default: ``true``
  195. If set to ``true``, the textarea for composing chat messages will automatically
  196. become focused as soon as a chat is opened. This means you don't need to click
  197. the textarea first before starting to type a message. This also applies to the
  198. username field which is automatically focused after the login controlbox is
  199. loaded.
  200. For applications where chat is not the main feature, automatic focus of the
  201. chat box might be undesired.
  202. auto_list_rooms
  203. ---------------
  204. * Default: ``false``
  205. If true, and the XMPP server on which the current user is logged in supports
  206. multi-user chat, then a list of rooms on that server will be fetched in the
  207. "Query for Groupchats" modal.
  208. Not recommended for servers with lots of chatrooms.
  209. For each room on the server a query is made to fetch further details (e.g.
  210. features, number of occupants etc.), so on servers with many rooms this
  211. option will create lots of extra connection traffic.
  212. If the `muc_domain`_ is locked with the `locked_muc_domain`_ setting, then
  213. rooms will automatically be fetched in the "Query for Groupchats" modal,
  214. regardless of the value of this setting.
  215. .. _`auto_login`:
  216. auto_login
  217. ----------
  218. * Default: ``false``
  219. This option can be used to let Converse automatically log the user in as
  220. soon as the page loads.
  221. If `authentication`_ is set to ``login``, then you will also need to provide a
  222. valid ``jid`` and ``password`` values, either manually by passing them in, or
  223. by the `credentials_url`_ setting. Setting a ``credentials_url`` is preferable
  224. to manually passing in ``jid`` and ``password`` values, because it allows
  225. better reconnection with `auto_reconnect`_. When the connection drops,
  226. Converse will automatically fetch new login credentials from the
  227. ``credentials_url`` and reconnect.
  228. If `authentication`_ is set to ``anonymous``, then you will also need to provide the
  229. server's domain via the `jid`_ setting.
  230. This is a useful setting if you'd like to create a custom login form in your
  231. website. You'll need to write some JavaScript to accept that custom form's
  232. login credentials, then you can pass those credentials (``jid`` and
  233. ``password``) to ``converse.initialize`` to start Converse and log the user
  234. in to their XMPP account.
  235. .. note::
  236. The interaction between ``keepalive`` and ``auto_login`` is unfortunately
  237. inconsistent depending on the `authentication`_ method used.
  238. If ``auto_login`` is set to ``false`` and `authentication`_ is set to
  239. ``anonymous``, ``external`` or ``prebind``, then Converse won't automatically
  240. log the user in.
  241. If `authentication`_ set to ``login`` the situation is much more
  242. ambiguous, since we don't have a way to distinguish between wether we're
  243. restoring a previous session (``keepalive``) or whether we're
  244. automatically setting up a new session (``auto_login``).
  245. So currently if EITHER ``keepalive`` or ``auto_login`` is ``true`` and
  246. `authentication`_ is set to ``login``, then Converse will try to log the user in.
  247. auto_away
  248. ---------
  249. * Default: ``0``
  250. The amount of seconds after which the user's presence status should
  251. automatically become ``away``.
  252. If the user's status is ``extended away``, it won't be changed to ``away``.
  253. If the given value is negative or ``0``, this option is disabled.
  254. auto_xa
  255. -------
  256. * Default: ``0``
  257. The amount of seconds after which the user's presence status should
  258. automatically become ``extended away``.
  259. If the value is negative or ``0``, the function is disabled.
  260. auto_reconnect
  261. --------------
  262. * Default: ``false``
  263. Automatically reconnect to the XMPP server if the connection drops
  264. unexpectedly.
  265. This option works best when you have `authentication`_ set to ``prebind`` and have
  266. also specified a ``prebind_url`` URL, from where Converse can fetch the BOSH
  267. tokens. In this case, Converse will automaticallly reconnect when the
  268. connection drops but also reestablish earlier lost connections (due to
  269. network outages, closing your laptop etc.).
  270. When `authentication`_ is set to `login`, then this option will only work when
  271. the page hasn't been reloaded yet, because then the user's password has been
  272. wiped from memory. This configuration can however still be useful when using
  273. Converse in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  274. or `electron <http://electron.atom.io/>`_.
  275. auto_register_muc_nickname
  276. --------------------------
  277. * Default: ``false``
  278. Determines whether Converse should automatically register a user's nickname
  279. when they enter a groupchat.
  280. See here fore more details: https://xmpp.org/extensions/xep-0045.html#register
  281. auto_subscribe
  282. --------------
  283. * Default: ``false``
  284. If true, the user will automatically subscribe back to any contact requests.
  285. auto_join_on_invite
  286. -------------------
  287. * Default: ``false``
  288. If true, the user will automatically join a chatroom on invite without any confirm.
  289. Also inviting users won't be prompted for a reason.
  290. auto_join_private_chats
  291. -----------------------
  292. * Default: ``[]``
  293. Allows you to provide a list of user JIDs for private (i.e. single) chats that
  294. should automatically be started upon login.
  295. For example::
  296. `['tom@example.org', 'dick@example.org', 'harry@example.org']`
  297. auto_join_rooms
  298. ---------------
  299. * Default: ``[]``
  300. This settings allows you to provide a list of groupchat conversations to be
  301. automatically joined once the user has logged in.
  302. You can either specify a simple list of room JIDs, in which case your nickname
  303. will be taken from your JID, or you can specify a list of maps, where each map
  304. specifies the room's JID and other options.
  305. For example::
  306. `[{'jid': 'room@example.org', 'nick': 'WizardKing69', 'minimized': true }]`
  307. blacklisted_plugins
  308. -------------------
  309. * Default: ``[]``
  310. A list of plugin names that are blacklisted and will therefore not be
  311. initialized once ``converse.initialize`` is called, even if the same plugin is
  312. whitelisted.
  313. From Converse 3.0 onwards most of the API is available only to plugins and
  314. all plugins need to be whitelisted first.
  315. The usecase for blacklisting is generally to disable removed core plugins
  316. (which are automatically whitelisted) to prevent other (potentially malicious)
  317. plugins from registering themselves under those names.
  318. The core, and by default whitelisted, plugins are::
  319. converse-bosh
  320. converse-bookmarks
  321. converse-chatboxes
  322. converse-chatview
  323. converse-controlbox
  324. converse-core
  325. converse-disco
  326. converse-dragresize
  327. converse-fullscreen
  328. converse-headline
  329. converse-mam
  330. converse-minimize
  331. converse-muc
  332. converse-muc-embedded
  333. converse-notification
  334. converse-ping
  335. converse-profile
  336. converse-register
  337. converse-roomslist
  338. converse-rosterview
  339. converse-singleton
  340. converse-smacks
  341. converse-spoilers
  342. converse-vcard
  343. Example:
  344. .. code-block:: javascript
  345. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  346. converse.initialize({
  347. // other settings removed for brevity
  348. blacklisted_plugins: [
  349. 'converse-dragresize',
  350. 'converse-minimize'
  351. ],
  352. });
  353. });
  354. .. _`bosh-service-url`:
  355. bosh_service_url
  356. ----------------
  357. * Default: ``undefined``
  358. Example: ``http://xmpp.example.com:5280/bosh/``
  359. Example with reverse-proxy and TLS: ``https://xmpp.example.com/bosh/``
  360. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  361. connection manager which acts as a middle man between the HTTP and XMPP
  362. protocols.
  363. The bosh_service_url setting takes the URL of a BOSH connection manager.
  364. Please refer to your XMPP server's documentation on how to enable BOSH.
  365. 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>`_
  366. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  367. Please see the :ref:`websocket-url` configuration setting.
  368. clear_cache_on_logout
  369. ---------------------
  370. * Default: ``false``
  371. If set to ``true``, all locally cached data will be cleared when the user logs out,
  372. regardless of the `persistent_store`_ being used (``localStorage``, ``IndexedDB`` or ``sessionStorage``).
  373. *Note*: If `allow_user_trust_override`_ is set to ``true`` and the user
  374. indicates that this device/browser is **not** trusted, then the cache will be
  375. cleared on logout, even if this setting is set to ``true``.
  376. *Note*: If this setting is set to ``true``, then OMEMO will be disabled, since
  377. otherwise it won't be possible to decrypt archived messages that were
  378. already decrypted previously (due to forward security).
  379. clear_messages_on_reconnection
  380. ------------------------------
  381. * Default: ``false``
  382. In some cases, it might be desirable to clear cached chat messages once you've
  383. reconnected to the XMPP server.
  384. For example, if you want to prevent the chat history from getting too long or
  385. if you want to avoid gaps in the chat history (for example due to MAM not
  386. returning all messages since the last cached message).
  387. Beware, if you're using OMEMO, then you probably don't want to set this setting to
  388. ``true``. OMEMO messages can be decrypted only once, so if they then
  389. subsequently get cleared, you won't get the plaintext back.
  390. chatstate_notification_blacklist
  391. --------------------------------
  392. * Default: ``[]``
  393. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  394. Some user's clients routinely connect and disconnect (likely on mobile) and
  395. each time a chat state notificaion is received (``online`` when connecting and
  396. then ``offline`` when disconnecting).
  397. When desktop notifications are turned on (see `show-desktop-notifications`_),
  398. then you'll receive notification messages each time this happens.
  399. Receiving constant notifications that a user's client is connecting and disconnecting
  400. is annoying, so this option allows you to ignore those JIDs.
  401. connection_options
  402. ------------------
  403. * Default: ``{}``
  404. * Type: Object
  405. Converse relies on `Strophe.js <http://strophe.im>`_ to establish and
  406. maintain a connection to the XMPP server.
  407. This option allows you to pass a map of configuration options to be passed into
  408. the ``Strophe.Connection`` constructor.
  409. For documentation on the configuration options that ``Strophe.Connection``
  410. accepts, refer to the
  411. `Strophe.Connection documentation <http://strophe.im/strophejs/doc/1.2.8/files/strophe-js.html#Strophe.Connection.Strophe.Connection>`_.
  412. Restricting the supported authentication mechanisms:
  413. ****************************************************
  414. As an example, suppose you want to restrict the supported SASL authentication
  415. mechanisms, then you'd pass in the ``mechanisms`` as a ``connection_options``
  416. ``key:value`` pair:
  417. .. code-block:: javascript
  418. converse.initialize({
  419. connection_options: {
  420. 'mechanisms': [
  421. converse.env.Strophe.SASLMD5,
  422. ]
  423. }
  424. });
  425. Running the XMPP Connection inside a shared worker
  426. **************************************************
  427. Newer versions of Strophe.js, support the ability to run the XMPP Connection
  428. inside a `shared worker <https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker>`_ that's shared
  429. between open tabs in the browser in which Converse is running (and which have the same domain).
  430. *Note:* This feature is experimental and there currently is no way to
  431. synchronize actions between tabs. For example, sent 1-on-1 messages aren't
  432. reflected by the server, so you if you send such a message in one tab, it won't
  433. appear in another.
  434. .. code-block:: javascript
  435. converse.initialize({
  436. connection_options: { 'worker': true }
  437. });
  438. .. _`credentials_url`:
  439. credentials_url
  440. ---------------
  441. * Default: ``null``
  442. * Type: URL
  443. This setting should be used in conjunction with `authentication`_ set to ``login``.
  444. It allows you to specify a URL which Converse will call when it needs to get
  445. the username and password (or authentication token) which Converse will use
  446. to automatically log the user in.
  447. If `auto_reconnect`_ is also set to ``true``, then Converse will automatically
  448. fetch new credentials from the ``credentials_url`` whenever the connection or
  449. session drops, and then attempt to reconnect and establish a new session.
  450. If the request to the ``credentials_url`` URL fails for whatever reason,
  451. Converse will continuously retry to fetch the credentials every 2 seconds.
  452. The server behind ``credentials_url`` should return a JSON encoded object::
  453. {
  454. "jid": "me@example.com/resource",
  455. "password": "Ilikecats!"
  456. }
  457. csi_waiting_time
  458. ----------------
  459. * Default: ``0``
  460. This option adds support for `XEP-0352 Client State Indication <https://xmpp.org/extensions/xep-0352.html>_`
  461. If Converse is idle for the configured amount of seconds, a chat state
  462. indication of ``inactive`` will be sent out to the XMPP server (if the server
  463. supports CSI).
  464. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  465. a chat state indication of ``active`` will be sent out.
  466. A value of ``0`` means that this feature is disabled.
  467. .. _`loglevel`:
  468. loglevel
  469. --------
  470. * Default: ``'info'``
  471. * Allowed values: ``'debug'``, ``'info'``, ``'warn'``, ``'error'``, ``'fatal'``
  472. You can also set this value by changing a URL fragment `#converse?loglevel=debug`
  473. default_domain
  474. --------------
  475. * Default: ``undefined``
  476. Specify a domain to act as the default for user JIDs. This allows users to log
  477. in with only the username part of their JID, instead of the full JID.
  478. For example, if ``default_domain`` is ``example.org``, then the user
  479. ``johnny@example.org`` can log in with only ``johnny``.
  480. JIDs with other domains are still allowed but need to be provided in full.
  481. To specify only one domain and disallow other domains, see the `locked_domain`_
  482. option.
  483. registration_domain
  484. -------------------
  485. * Default: ``''``
  486. Specify a domain name for which the registration form will be fetched automatically,
  487. without the user having to enter any XMPP server domain name.
  488. default_state
  489. -------------
  490. * Default: ``'online'``
  491. The default chat status that the user wil have. If you for example set this to
  492. ``'chat'``, then Converse will send out a presence stanza with ``"show"``
  493. set to ``'chat'`` as soon as you've been logged in.
  494. discover_connection_methods
  495. ---------------------------
  496. * Default: ``true``
  497. Use `XEP-0156 <https://xmpp.org/extensions/xep-0156.html>`_ to discover whether
  498. the XMPP host for the current user advertises any Websocket or BOSH connection
  499. URLs that can be used.
  500. If this is set to ``false``, then a `websocket_url`_ or `bosh_service_url`_ need to be
  501. set.
  502. Currently only the XML encoded host-meta resource is supported as shown in
  503. `Example 2 under section 3.3 <https://xmpp.org/extensions/xep-0156.html#httpexamples>`_.
  504. domain_placeholder
  505. ------------------
  506. * Default: ``e.g. conversejs.org``
  507. The placeholder text shown in the domain input on the registration form.
  508. emoji_categories
  509. ----------------
  510. * Default:
  511. ::
  512. {
  513. "smileys": ":grinning:",
  514. "people": ":thumbsup:",
  515. "activity": ":soccer:",
  516. "travel": ":motorcycle:",
  517. "objects": ":bomb:",
  518. "nature": ":rainbow:",
  519. "food": ":hotdog:",
  520. "symbols": ":musical_note:",
  521. "flags": ":flag_ac:",
  522. "custom": ":converse:"
  523. }
  524. This setting lets you define the categories that are available in the emoji
  525. picker, as well as the default image that's shown for each category.
  526. The keys of the map are the categories and the values are the shortnames of the
  527. representative images.
  528. If you want to remove a category, don't just remove the key, instead set its
  529. value to ``undefined``.
  530. Due to restrictions intended to prevent addition of undeclared configuration
  531. settings, it's not possible to add new emoji categories. There is however a
  532. ``custom`` category where you can put your own custom emojis (also known as
  533. "stickers").
  534. To add custom emojis, you need to edit ``src/headless/emojis.json`` to add new
  535. entries to the map under the ``custom`` key.
  536. emoji_categories_label
  537. ----------------------
  538. * Default:
  539. ::
  540. {
  541. "smileys": "Smileys and emotions",
  542. "people": "People",
  543. "activity": "Activities",
  544. "travel": "Travel",
  545. "objects": "Objects",
  546. "nature": "Animals and nature",
  547. "food": "Food and drink",
  548. "symbols": "Symbols",
  549. "flags": "Flags",
  550. "custom": "Stickers"
  551. }
  552. This setting lets you pass in the text value that goes into the `title`
  553. attribute for the emoji categories. These strings will be translated, but for
  554. your custom text to be translatable, you'll need to wrap it in `__()``
  555. somewhere in your own code.
  556. emoji_image_path
  557. ----------------
  558. * Default: ``'https://twemoji.maxcdn.com/2/'``
  559. When `use_system_emojis`_ is set to ``false``, then this is the URL from where image files for
  560. displaying emojis will be fetched.
  561. enable_muc_push
  562. ---------------
  563. * Default: ``false``
  564. If true, then Converse will try to register
  565. `XEP-0357 push notification App Server(s) <https://xmpp.org/extensions/xep-0357.html#general-architecture>`_
  566. for the MUC domain of any newly entered groupchat.
  567. The app servers are specified with the `push_app_servers`_ option.
  568. .. note::
  569. Registering a push app server against a MUC domain is not (yet) standardized
  570. and this feature should be considered experimental.
  571. enable_smacks
  572. -------------
  573. * Default: ``false``
  574. Determines whether `XEP-0198 Stream Management <https://xmpp.org/extensions/xep-0198.html>`_
  575. support is turned on or not.
  576. Recommended to set to ``true`` if a websocket connection is used.
  577. Please see the :ref:`websocket-url` configuration setting.
  578. filter_by_resource
  579. ------------------
  580. * Default: ``false``
  581. Before version 1.0.3 Converse would ignore received messages if they were
  582. intended for a different resource then the current user had. It was decided to
  583. drop this restriction but leave it configurable.
  584. filter_url_query_params
  585. -----------------------
  586. * Default: ``null``
  587. Accepts a string or array of strings. Any query strings from URLs that match this setting will be removed.
  588. fullname
  589. --------
  590. If you are using prebinding, can specify the fullname of the currently
  591. logged in user, otherwise the user's vCard will be fetched.
  592. geouri_regex
  593. ------------
  594. * Default: ``/https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g``
  595. Regular expression used to extract geo coordinates from links to openstreetmap.
  596. geouri_replacement
  597. ------------------
  598. * Default: ``'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2'``
  599. String used to replace geo-URIs with. Ought to be a link to osm or similar. ``$1`` and ``$2`` is replaced by
  600. latitude and longitude respectively.
  601. hide_muc_participants
  602. ---------------------
  603. * Default: ``false``
  604. Option which allows you to hide the participants list by default.
  605. hide_offline_users
  606. ------------------
  607. * Default: ``false``
  608. If set to ``true``, then offline users aren't shown in the roster.
  609. hide_open_bookmarks
  610. -------------------
  611. * Default: ``false`` (``true`` when the `view_mode`_ is set to ``fullscreen``).
  612. This setting applies to the ``converse-bookmarks`` plugin and specfically the
  613. list of bookmarks shown in the ``Rooms`` tab of the control box.
  614. By default all bookmarks are shown in that list, if this setting is set to
  615. ``true``, then only bookmarks for rooms not currently open (i.e. that the
  616. current user hasn't joined), are shown.
  617. Makes sense to set this to ``true`` when also using the non-core
  618. ``converse-roomslist`` plugin, which shows a list of currently open (i.e.
  619. "joined") rooms.
  620. .. _`i18n`:
  621. i18n
  622. ----
  623. * Default: Auto-detection of the User/Browser language or ``en``;
  624. Specify the locale/language.
  625. The translations for that locale must be served in JSON format at `/dist/locales/${i18n}-LC_MESSAGES-converse-po.js`.
  626. The default webpack configuration for Converse.js ensures that these files are
  627. generated and placed in the right location.
  628. If an explicit locale is specified via the ``i18n`` setting and the
  629. translations for that locale are not found, then Converse will fall back to trying to determine the browser's language
  630. and fetching those translations, or if that fails the default English strings will be used.
  631. idle_presence_timeout
  632. ---------------------
  633. * Default: ``300``
  634. The amount of seconds after which the user is considered to be idle
  635. and an idle presence according to XEP-0319 is sent.
  636. If the given value is negative or ``0``, this feature is disabled.
  637. image_urls_regex
  638. ----------------
  639. * Default: ``null``
  640. Any URL in a message that matches the regex in this setting will be considered an image and rendered, if `show_images_inline`_ is set to ``true``.
  641. If the image cannot be rendered, a hyperlink will be rendered instead.
  642. For example, to render Imgur images inline, you can use the following regex: ``/^https?:\/\/(?:www.)?(?:imgur\.com\/\w{7})\/?$/i``
  643. jid
  644. ---
  645. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  646. on the XMPP network. It looks like an email address, but it's used for instant
  647. messaging instead.
  648. This value may be provided together with a ``password`` instead of supplying a
  649. `credentials_url`_ when setting ``auto_login`` to ``true``.
  650. .. _`keepalive`:
  651. keepalive
  652. ---------
  653. * Default: ``true``
  654. Determines whether Converse will attempt to keep you logged in across page loads.
  655. .. _`locales`:
  656. locales
  657. -------
  658. * Default:
  659. .. code-block:: javascript
  660. locales: [
  661. 'af', 'ca', 'de',
  662. 'es', 'en', 'fr',
  663. 'he', 'hu', 'id',
  664. 'it', 'ja', 'nb',
  665. 'nl', 'pl', 'pt_BR',
  666. 'ru', 'uk', 'zh'
  667. ]
  668. This setting restricts the locales that are supported by Converse and
  669. therefore what may be given as value for the :ref:`i18n` option.
  670. Any other locales will be ignored.
  671. locked_domain
  672. -------------
  673. * Default: ``undefined``
  674. Similar to `default_domain`_ but no other domains are allowed.
  675. For example, if ``locked_domain`` is set to ``example.org``, then the user
  676. ``johnny@example.org`` can log in with only ``johnny``.
  677. Additionally, only users registered on the ``example.org`` host can log in, no
  678. other users are allowed to log in.
  679. locked_muc_domain
  680. -----------------
  681. * Default: ``false``
  682. * Allowed values: ``false``, ``true``, ``'hidden'``
  683. By setting this value to something truthy, you restrict the multi-user chat (MUC) domain to only the value
  684. specified in `muc_domain`_.
  685. If the value is set to `'hidden'` (which is also truthy), then the MUC domain
  686. will not be shown to users.
  687. locked_muc_nickname
  688. -------------------
  689. * Default: ``false``
  690. This setting allows you to restrict the multi-user chat (MUC) nickname that a
  691. user uses to a particular value.
  692. Where the nickname value comes from depends on other settings.
  693. The `nickname`_ configuration setting takes precedence ahead of any other
  694. nickname value. If that's not set, then the "nickname" value from the user's
  695. VCard is taken, and if that is not set but `muc_nickname_from_jid`_ is set to
  696. ``true``, then the node of the user's JID (the part before the ``@``) is used.
  697. If no nickame value is found, then an error will be raised.
  698. muc_hats
  699. -------------------
  700. * Default: ``['xep317']``
  701. Since version 7 Converse now has rudimentary support for `XEP-0317 Hats <https://xmpp.org/extensions/xep-0317.html>`_.
  702. It is also possible to display VCard roles, MUC affiliation and MUC role along with hats.
  703. By default only XEP-0317 hats are considered.
  704. For the inclusion of VCard roles ``'vcard_roles'`` must be added to the list.
  705. For the inclusion of MUC affiliation and MUC role, the specific affiliations and roles
  706. to be used must be added to the list e.g. ``'owner','participant'``.
  707. Example:
  708. For XEP-0317 hats and VCard roles this setting should be set to:
  709. ``'muc_hats': ['xep317', 'vcard_roles']``
  710. For VCard roles, admin MUC affiliation and moderator MUC role:
  711. ``'muc_hats': ['vcard_roles', 'admin', 'moderator']``
  712. And to prevent the displaying of anything, an empty list must be used:
  713. ``'muc_hats': []``
  714. muc_mention_autocomplete_min_chars
  715. -----------------------------------
  716. * Default: ``0``
  717. The number of characters that need to be entered before the auto-complete list
  718. of matching nicknames is shown.
  719. muc_mention_autocomplete_filter
  720. -------------------------------
  721. * Default: ``contains``
  722. The method used for filtering MUC participants when using auto-complete.
  723. Valid values are ``contains`` and ``starts_with``.
  724. muc_mention_autocomplete_show_avatar
  725. ------------------------------------
  726. * Default: ``true``
  727. Show avatars of MUC participants when using auto-complete.
  728. message_archiving
  729. -----------------
  730. * Default: ``undefined``
  731. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  732. whereby messages are archived in the XMPP server for later retrieval.
  733. Note, your XMPP server must support XEP-0313 MAM for this to work.
  734. This option sets the default archiving preference.
  735. Valid values are ``undefined``, ``never``, ``always`` and ``roster``.
  736. ``undefined`` means that any existing MAM configuration, as set by the user or
  737. the server administrator, will be used.
  738. ``roster`` means that only messages to and from JIDs in your roster will be
  739. archived. The other two values are self-explanatory.
  740. message_archiving_timeout
  741. -------------------------
  742. * Default: ``20000``
  743. The amount of time (in milliseconds) to wait when requesting archived messages
  744. from the XMPP server.
  745. Used in conjunction with ``message_archiving`` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  746. message_carbons
  747. ---------------
  748. * Default: ``true``
  749. Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>`_
  750. In order to keep all IM clients for a user engaged in a conversation,
  751. outbound messages are carbon-copied to all interested resources.
  752. This is especially important with Converse, where each browser
  753. tab serves as a separate IM client.
  754. XEP-0280 requires server support, so make sure that message carbons are enabled
  755. on your server.
  756. message_limit
  757. -------------
  758. * Default: ``0``
  759. Determines the allowed amount of characters in a chat message. A value of zero means there is no limit.
  760. Note, this limitation only applies to the Converse UX code running in the browser
  761. and it's trivial for an attacker to bypass this restriction.
  762. You should therefore also configure your XMPP server to limit message sizes.
  763. modtools_disable_assign
  764. -----------------------
  765. * Default: ``false``
  766. * Possible Values: ``true``, ``false``, ``['owner', 'admin', 'member', 'outcast', 'none', 'moderator', 'participant', 'visitor']``
  767. This setting allows you to disable (either completely, or fine-grained) which affiliations and or roles
  768. may be assigned in the moderator tools modal.
  769. modtools_disable_query
  770. ----------------------
  771. * Default: ``[]``
  772. * Possible Values: ``['owner', 'admin', 'member', 'outcast', 'none', 'moderator', 'participant', 'visitor']``
  773. This setting allows you to disable which affiliations or roles may be queried in the moderator tools modal.
  774. If all roles or all affiliations are disabled, then the relevant tab won't be
  775. showed at all.
  776. muc_disable_slash_commands
  777. --------------------------
  778. * Default: ``false``
  779. Allows you to disable the moderator commands such as ``/kick`` or ``/ban``.
  780. Ìf set to ``true`` all commands will be disabled.
  781. You can also selectively disable some moderator commands by setting it to an
  782. array of commands you don't want.
  783. The following example will disable 'mute' and 'voice' command:
  784. .. code-block:: javascript
  785. muc_disable_slash_commands: ['mute', 'voice'],
  786. muc_domain
  787. ----------
  788. * Default: ``undefined``
  789. The default MUC (multi-user chat) domain that should be used.
  790. When setting this value, users can only enter the name when opening a new MUC,
  791. and don't have to add the whole address (i.e. including the domain part).
  792. Users can however still enter the domain and they can still open MUCs with
  793. other domains.
  794. If you want to restrict MUCs to only this domain, then set `locked_muc_domain`_ to
  795. ``true``.
  796. muc_fetch_members
  797. -----------------
  798. * Default: ``true``
  799. * Possible values: Array containing any of the following: ``['member', 'admin', 'owner']``
  800. Determines whether Converse.js will fetch the member lists for a MUC
  801. (multi-user chat) when the user first enters it.
  802. Here's the relevant part from the MUC XEP: https://xmpp.org/extensions/xep-0045.html#getmemberlist
  803. The MUC service won't necessarily allow any user to fetch member lists,
  804. but can usually be configured to do so.
  805. The member lists consists of three lists of users who have the affiliations
  806. ``member``, ``admin`` and ``owner`` respectively.
  807. By fetching member lists, Converse.js will always show these users as
  808. participants of the MUC, giving them a permanent "presence" in the MUC.
  809. muc_history_max_stanzas
  810. -----------------------
  811. * Default: ``undefined``
  812. This option allows you to specify the maximum amount of messages to be shown in a
  813. chatroom when you enter it. By default, the amount specified in the room
  814. configuration or determined by the server will be returned.
  815. Please note, this option is not related to
  816. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  817. which also allows you to show archived chatroom messages, but follows a
  818. different approach.
  819. If you're using MAM for archiving chatroom messages, you might want to set
  820. this option to zero.
  821. muc_instant_rooms
  822. ------------------
  823. * Default: ``true``
  824. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  825. Otherwise rooms first have to be configured before they're available to other
  826. users (so-called "registered rooms" in `MUC-0045 <https://xmpp.org/extensions/xep-0045.html#createroom>`_).
  827. From a UX perspective, if this settings is `false`, then a configuration form will
  828. render, that has to be filled in first, before the room can be joined by other
  829. users.
  830. muc_nickname_from_jid
  831. ---------------------
  832. * Default: ``false``
  833. When set to ``true``, then users will not be prompted to provide nicknames for
  834. chatrooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  835. will be used. If the user's nickname is already taken by another user in the
  836. chatroom, then an integer will be added to make it unique.
  837. So, for example, if john@example.com joins a chatroom, his nickname will
  838. automatically be "john". If now john@differentdomain.com tries to join the
  839. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  840. his nickname will be "john-3", and so forth.
  841. muc_send_probes
  842. ---------------
  843. * Default: ``false``
  844. If set to ``true``, then whenever Converse receives a MUC message with an author for which we don't have
  845. any information (i.e. because that user is currently not in the MUC), then Converse will send out a ``<presence>``
  846. stanza of type ``probe`` in order to request the authors presence data.
  847. Prosody has some experimental support in it's contrib branch (hopefully soon to
  848. be merged to trunk).
  849. The point of sending out presence probes is in order to receive
  850. presence-related metadata, such as `XEP-0317 Hats <https://xmpp.org/extensions/xep-0317.html>`_.
  851. .. note::
  852. Although this behavior is described in the `presence business rules of XEP-0045, section 17.3 point 4 <https://xmpp.org/extensions/xep-0045.html#bizrules-presence>`_,
  853. few XMPP servers support this.
  854. .. note::
  855. If member lists are fetched via muc_fetch_members, then the occupants created
  856. based on those member lists won't be probed again later (given that the
  857. occupants are already created). Certain metadata like XEP-0317 hats are not
  858. included in the member lists, which means that this metadata will be missing for
  859. those occupants.
  860. muc_respect_autojoin
  861. --------------------
  862. * Default; ``true``
  863. Determines whether Converse will respect the autojoin-attribute of bookmarks. Per default
  864. all MUCs with set autojoin flag in their respective bookmarks will be joined on
  865. startup of Converse. When set to ``false`` no MUCs are automatically joined based on
  866. their bookmarks.
  867. muc_roomid_policy
  868. -----------------
  869. * Default: ``null``
  870. This option defines the regular expression that a room id must satisfy to allow the
  871. room creation. Server administrators may want to impose restrictions on the minimum
  872. and maximum length and the allowed character set allowed for room ids. Otherwise
  873. users might create rooms which are difficult to handle.
  874. However, restricting that on the server only leads to bad UX as users might learn of
  875. the servers policy only after they have tried to create a room. Furthermore error
  876. messages from XMPP-servers might not be self-explanatory.
  877. Therefore this option allows converse to already check the policy and disallow the
  878. user from even trying to entering/creating such a room.
  879. As this only makes sense on your own server, the check is applied only if the domain
  880. part equals `muc_domain`_. If `muc_domain`_ is unset, then this check is disabled
  881. completely.
  882. Example:
  883. .. code-block:: javascript
  884. muc_roomid_policy: /^[a-z0-9._-]{5,40}$/,
  885. See also: `muc_roomid_policy_hint`_
  886. muc_roomid_policy_hint
  887. ----------------------
  888. * Default: ``null``
  889. This option can be used in conjuction with `muc_roomid_policy`_ in order to give
  890. a written explanation of the imposed room id policy. You can use the html-tags
  891. ``<br>``, ``<b>``, and ``<em>`` to allow some basic styling.
  892. Example:
  893. .. code-block:: javascript
  894. muc_roomid_policy_hint: '<br><b>Policy for groupchat id:</b><br>- between 5 and 40 characters,<br>- lowercase from a to z (no special characters) or<br>- digits or<br>- dots (.) or<br>- underlines (_) or<br>- hyphens (-),<br>- no spaces<br>',
  895. muc_show_join_leave
  896. -------------------
  897. * Default; ``true``
  898. Determines whether Converse will show info messages inside a chatroom
  899. whenever a user joins or leaves it.
  900. muc_show_logs_before_join
  901. -------------------------
  902. * Default: ``false``
  903. If set to ``true``, when opening a MUC for the first time (or if you don't have
  904. a nickname configured for it), you'll see the message history (if the
  905. server supports [XEP-0313 Message Archive Management](https://xmpp.org/extensions/xep-0313.html))
  906. and the nickname form at the bottom.
  907. .. _`nickname`:
  908. nickname
  909. --------
  910. * Default: ``undefined``
  911. This setting allows you to specify the nickname for the current user.
  912. The nickname will be included in presence requests to other users and will also
  913. be used as the default nickname when entering MUC chatrooms.
  914. This value will have first preference ahead of other nickname sources, such as
  915. the VCard ``nickname`` value.
  916. notify_all_room_messages
  917. ------------------------
  918. * Default: ``false``
  919. By default, sound and desktop notifications will only be made when you are
  920. mentioned in a room. If you set this setting to `true`, then you will be
  921. notified of all messages received in a room.
  922. You can also pass an array of room JIDs to this option, to only apply it to
  923. certain rooms.
  924. notification_delay
  925. ------------------
  926. * Default: ``5000``
  927. Desktop notifications will be shown for a time of ``notification_delay``
  928. ms. Setting this to ``0`` will make the notification stay until dismissed by
  929. the user (requires browser support).
  930. notification_icon
  931. -----------------
  932. * Default: ``'logo/conversejs-filled.svg'``
  933. This option specifies which icon is shown in HTML5 notifications, as provided
  934. by the ``src/converse-notification.js`` plugin.
  935. notify_nicknames_without_references
  936. -----------------------------------
  937. * Default: ``false``
  938. Enables notifications for nicknames in messages that don't have associated
  939. XEP-0372 references linking them to the JID of the person being mentioned.
  940. In Converse, these would be nicknames that weren't mentioned via the ``@`` sign.
  941. oauth_providers
  942. ---------------
  943. * Default: ``[]``
  944. Allows you to specify a list of OAuth providers that the user may use to log in
  945. with.
  946. .. note::
  947. Your XMPP server will have to support Oauth logins
  948. .. code-block:: javascript
  949. converse.initialize({
  950. oauth_providers: {
  951. 'github': {
  952. 'client_id': '1338d9f7ff52b1309b29',
  953. 'host': 'chat.example.org',
  954. 'class': 'fa-github-alt',
  955. 'id': 'github',
  956. 'name': 'Github'
  957. },
  958. 'twitter': {
  959. 'client_id': '0332d98cff83b1999b22',
  960. 'host': 'chat.example.org',
  961. 'class': 'fa-twitter',
  962. 'id': 'twitter',
  963. 'name': 'Twitter'
  964. }
  965. },
  966. });
  967. omemo_default
  968. -------------
  969. * Default: ``false``
  970. Use OMEMO encryption by default when the chat supports it.
  971. ping_interval
  972. -------------
  973. * Default: ``60``
  974. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  975. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  976. You need to set the value to any positive value to enable this functionality.
  977. If you set this value to ``0`` or any negative value, il will disable this functionality.
  978. .. _`play-sounds`:
  979. play_sounds
  980. -----------
  981. * Default: ``false``
  982. Plays a notification sound when you receive a personal message or when your
  983. nickname is mentioned in a chatroom.
  984. Inside the ``./sounds`` directory of the Converse repo you'll see MP3 and Ogg
  985. formatted sound files. We need both, because neither format is supported by all browsers.
  986. You can set the URL where the sound files are hosted with the `sounds_path`_ option.
  987. Requires the `src/converse-notification.js` plugin.
  988. .. _`prebind_url`:
  989. prebind_url
  990. -----------
  991. * Default: ``null``
  992. * Type: URL
  993. See also: :ref:`session-support`
  994. This setting should be used in conjunction with `authentication`_ set to `prebind`.
  995. It allows you to specify a URL which Converse will call when it needs to get
  996. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  997. Converse will then attach to.
  998. The server behind ``prebind_url`` should return a JSON encoded object with the
  999. three tokens::
  1000. {
  1001. "jid": "me@example.com/resource",
  1002. "sid": "346234623462",
  1003. "rid": "876987608760"
  1004. }
  1005. priority
  1006. --------
  1007. * Default: ``0``
  1008. * Type: Number
  1009. Determines the priority used for presence stanzas sent out from this resource
  1010. (i.e. this instance of Converse).
  1011. The priority of a given XMPP chat client determines the importance of its presence
  1012. stanzas in relation to stanzas received from other clients of the same user.
  1013. In Converse, the indicated chat status of a roster contact will be taken from the
  1014. presence stanza (and associated resource) with the highest priority.
  1015. If multiple resources have the same top priority, then the chat status will be
  1016. taken from the most recent present stanza.
  1017. 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>`_.
  1018. providers_link
  1019. --------------
  1020. * Default: ``https://xmpp.net/directory.php``
  1021. The hyperlink on the registration form which points to a directory of public
  1022. XMPP servers.
  1023. .. _`assets_path`:
  1024. assets_path
  1025. -----------
  1026. * Default: ``'/dist/'`` or the `publicPath <https://webpack.js.org/guides/public-path/>`_ value as configured in the relevant Webpack configuration.
  1027. Since version 5.0.0, Converse serves a smaller bundle by extracting various
  1028. resources (for example emojis and translations) into separate files (aka
  1029. "chunks") which are loaded asynchronously on demand.
  1030. The URL path at which these resources are loaded is normally set by the ``publicPath``
  1031. setting of Webpack but this means that it's hardcoded to a particular value at
  1032. compile time.
  1033. This configuration seting allows this value to be set at runtime as well.
  1034. persistent_store
  1035. ----------------
  1036. * Default: ``localStorage``
  1037. * Valid options: ``localStorage``, ``IndexedDB``, ``sessionStorage``, ``BrowserExtLocal``, ``BrowserExtSync``
  1038. Determines which store is used for storing persistent data.
  1039. From version 6.0.0 onwards, Converse supports storing data in
  1040. `IndexedDB <https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB>`_.
  1041. IndexedDB is not subjected to the same space constraints as localStorage and is
  1042. also a requirement for progressive web apps which don't need persistent a
  1043. internet connectivity to be functional.
  1044. From version 7.0.0 onwards, Converse supports storing data in
  1045. `Browser Extension storage <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage#Example_extensions>`_.
  1046. When Converse is running inside a web browser extension, it can now take advantage of storage optimized to meet the specific storage needs of extensions.
  1047. BrowserExtSync represents the sync storage area.
  1048. Items in sync storage are synced by the browser and are available across all instances of that browser that the user is logged into, across different devices.
  1049. BrowserExtLocal represents the local storage area.
  1050. Items in local storage are local to the machine the extension was installed on
  1051. push_app_servers
  1052. ----------------
  1053. * Default: ``[]``
  1054. This option lets you enable or disable so-called push notification "App Servers"
  1055. (as per `XEP-0357 <https://xmpp.org/extensions/xep-0357.html>`_).
  1056. For each "App Server" an object needs to be passed in. When enabling, you need
  1057. to specify ``jid`` and ``node`` values. You can also provide a
  1058. ``secret``, if required by your App Server.
  1059. When disabling, you need to specify at least a ``jid`` and set ``disabled`` to
  1060. ``true``. This will disable notifications to all pubsub nodes on that "App
  1061. Server". If you want to disable only a particular node, then specify a ``node``
  1062. value as well.
  1063. For example:
  1064. .. code-block:: javascript
  1065. converse.initialize({
  1066. 'push_app_servers': [{
  1067. 'jid': 'push-4@client.example',
  1068. 'node': 'yxs32uqsflafdk3iuqo',
  1069. 'disable': true
  1070. }, {
  1071. 'jid': 'push-5@client.example',
  1072. 'node': 'yxs32uqsflafdk3iuqo',
  1073. }]
  1074. });
  1075. .. _`roomconfig_whitelist`:
  1076. roomconfig_whitelist
  1077. --------------------
  1078. * Default: ``[]``
  1079. A list of room config-option names. If this list is non-empty, only the corresponding room
  1080. config-options will be shown in the room configuration form. The default will show all options.
  1081. In the following example the user can only see (and thus change) the roomname and nothing else:
  1082. .. code-block:: javascript
  1083. roomconfig_whitelist: ['muc#roomconfig_roomname'],
  1084. root
  1085. ----
  1086. * Default: ``window.document``
  1087. When using Converse inside a web component's shadow DOM, you will need to set this settings'
  1088. value to the shadow-root of the shadow DOM.
  1089. For example:
  1090. .. code-block:: javascript
  1091. class CustomChatComponent extends HTMLElement {
  1092. constructor() {
  1093. super();
  1094. const shadowRoot = this.attachShadow({mode: "open"});
  1095. this.initConverse(shadowRoot);
  1096. }
  1097. initConverse(shadowRoot) {
  1098. window.addEventListener("converse-loaded", function(event) {
  1099. const { converse } = event.detail;
  1100. converse.initialize({
  1101. root: shadowRoot,
  1102. // Other settings go here...
  1103. });
  1104. });
  1105. }
  1106. }
  1107. roster_groups
  1108. -------------
  1109. * Default: ``true``
  1110. If set to ``true``, Converse will show any roster groups you might have configured.
  1111. .. note::
  1112. It's currently not possible to use Converse to assign contacts to groups.
  1113. Converse can only show users and groups that were previously configured
  1114. elsewhere.
  1115. send_chat_state_notifications
  1116. -----------------------------
  1117. * Default: ``true``
  1118. Determines whether chat state notifications (see `XEP-0085 <https://xmpp.org/extensions/xep-0085.html>`_) should be sent out or not.
  1119. Can also be set to an Array in order to allow only certain types of chat state notifications.
  1120. For example:
  1121. .. code-block:: javascript
  1122. converse.initialize({
  1123. 'send_chat_state_notifications': ['composing']
  1124. });
  1125. Valid values are ``'active', 'composing', 'gone' 'inactive', 'paused'``
  1126. show_chat_state_notifications
  1127. -----------------------------
  1128. * Default: ``false``
  1129. Specifies whether chat state (online, dnd, away) HTML5 desktop notifications should be shown.
  1130. show_client_info
  1131. ----------------
  1132. * Default: ``true``
  1133. Specifies whether the info icon is shown on the controlbox which when clicked opens an
  1134. "About" modal with more information about the version of Converse being used.
  1135. show_controlbox_by_default
  1136. --------------------------
  1137. * Default: ``false`` (``true`` when the `view_mode`_ is set to ``fullscreen``)
  1138. The "controlbox" refers to the special chatbox containing your contacts roster,
  1139. status widget, chatrooms and other controls.
  1140. By default this box is hidden and can be toggled by clicking on any element in
  1141. the page with class *toggle-controlbox*.
  1142. If this options is set to true, the controlbox will by default be shown upon
  1143. page load.
  1144. However, be aware that even if this value is set to ``false``, if the
  1145. controlbox is open, and the page is reloaded, then it will stay open on the new
  1146. page as well.
  1147. .. _`show-desktop-notifications`:
  1148. show_desktop_notifications
  1149. --------------------------
  1150. * Default: ``true``
  1151. Should HTML5 desktop notifications be shown?
  1152. If set to ``true``, notifications will be shown in the following cases:
  1153. * the browser is not visible nor focused and a private message is received.
  1154. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  1155. * ``auto_subscribe`` is set to ``false`` and a new contact request is received.
  1156. If set to ``all``, notifications will be shown even if the above conditions are
  1157. not fulfilled.
  1158. Requires the `src/converse-notification.js` plugin.
  1159. show_message_avatar
  1160. -------------------
  1161. * Default: ``true``
  1162. Whether chat messages should also render the author's avatar.
  1163. show_images_inline
  1164. ------------------
  1165. * Default: ``true``
  1166. If set to ``false``, images won't be rendered in chats, instead only their links will be shown.
  1167. It also accepts an array strings of whitelisted domain names to only render images that belong to those domains.
  1168. E.g. ``['imgur.com', 'imgbb.com']``
  1169. show_retraction_warning
  1170. -----------------------
  1171. * Default: ``true``
  1172. From `XEP-0424: Message Retraction <https://xmpp.org/extensions/xep-0424.html>`_:
  1173. ::
  1174. Due to the federated and extensible nature of XMPP it's not possible to remove a message with
  1175. full certainty and a retraction can only be considered an unenforceable request for such removal.
  1176. Clients which don't support message retraction are not obligated to enforce the request and
  1177. people could have seen or copied the message contents already.
  1178. By default Converse shows a warning to users when they retract a message, to
  1179. inform them that they don't have a guarantee that the message will be removed
  1180. everywhere.
  1181. This warning isn't applicable to all deployments of Converse and can therefore
  1182. be turned off by setting this config variable to ``false``.
  1183. show_send_button
  1184. ----------------
  1185. * Default: ``true``
  1186. Adds a button to the chat which can be clicked or tapped in order to send the
  1187. message.
  1188. singleton
  1189. ---------
  1190. * Default: ``false``
  1191. If set to ``true``, then only one chat (one-on-one or groupchat) will be allowed.
  1192. The chat must be specified with the `auto_join_rooms`_ or `auto_join_private_chats`_ options.
  1193. This setting is useful together with `view_mode`_ set to ``embedded``, when you
  1194. want to embed a chat into the page.
  1195. Alternatively you could use it with `view_mode`_ set to ``overlayed`` to create
  1196. a single helpdesk-type chat.
  1197. smacks_max_unacked_stanzas
  1198. --------------------------
  1199. * Default: ``5``
  1200. This setting relates to `XEP-0198 <https://xmpp.org/extensions/xep-0198.html>`_
  1201. and determines the number of stanzas to be sent before Converse will ask the
  1202. server for acknowledgement of those stanzas.
  1203. sounds_path
  1204. -----------
  1205. * Default: ``${assets_path}/sounds/``
  1206. This option only makes sense in conjunction with the `play_sounds`_ option and
  1207. specifies the URL of the sound files to be played (exluding the file names
  1208. themselves).
  1209. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  1210. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  1211. sticky_controlbox
  1212. -----------------
  1213. * Default: ``false`` (``true`` when the ``view_mode`` is set to ``fullscreen``).
  1214. If set to ``true``, the control box (which includes the login, registration,
  1215. contacts and rooms tabs) will not be closeable. It won't have a close button at
  1216. all.
  1217. The idea behind this setting is to provide a better experience on mobile
  1218. devices when the intent is to use Converse as a web app. In this case
  1219. it doesn't make sense to close the control box, as there's often then nothing
  1220. "behind" it that's relevant to the user.
  1221. .. _`strict_plugin_dependencies`:
  1222. strict_plugin_dependencies
  1223. --------------------------
  1224. * Default: ``false``
  1225. When set to ``true`` and a plugin tries to override an object which doesn't
  1226. exist (for example because the plugin which provides that object is not
  1227. loaded), then an error will be raised.
  1228. Otherwise a message will simply be logged and the override instruction ignored.
  1229. The Converse plugins architecture can have an :ref:`dependencies`
  1230. plugin attribute. This enables you to specify an array of other plugins which
  1231. this one depends on.
  1232. Converse (more specifically, `pluggable.js <https://jcbrand.github.io/pluggable.js/>`_)
  1233. will first load these dependencies before executing the plugin's overrides and
  1234. calling its ``initialize`` method.
  1235. This is especially important if you register event handlers in your plugin for
  1236. events that fire in other plugins. In this case, you want to specify those
  1237. other plugins as dependencies.
  1238. If ``strict_plugin_dependencies`` is set to ``false``, an error won't be raised
  1239. if the optional dependencies aren't found.
  1240. synchronize_availability
  1241. ------------------------
  1242. * Default: ``true``
  1243. * Valid options: ``true``, ``false``, ``a resource name``.
  1244. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  1245. if you change your status to ``busy`` in a different chat client, your status will change to ``busy`` in Converse as well.
  1246. If set to ``true``, Converse will synchronize with all other clients you are logged in with.
  1247. If set to ``false``, this feature is disabled.
  1248. If set to ``a resource name``, Converse will synchronize only with a client that has that particular resource assigned to it.
  1249. theme
  1250. -----
  1251. * Default: ``default``
  1252. * Valid options: ``default``, ``concord``
  1253. Let's you set a color theme for Converse.
  1254. time_format
  1255. -----------
  1256. * Default: ``HH:mm``
  1257. Examples: ``HH:mm``, ``hh:mm``, ``hh:mm a``.
  1258. This option makes the time format for the time shown, for each message, configurable. Converse uses `DayJS <https://github.com/iamkun/dayjs>`_
  1259. for showing time. This option allows the configuration of the format in which ``DayJS`` will display the time for the messages. For detailed
  1260. description of time-format options available for ``DayJS`` you can check the
  1261. `default formatting options <https://github.com/iamkun/dayjs/blob/dev/docs/en/API-reference.md#displaying>`_ and the
  1262. `advanced options <https://github.com/iamkun/dayjs/blob/master/docs/en/Plugin.md#advancedformat>`_.
  1263. use_system_emojis
  1264. -----------------
  1265. * Default: ``true``
  1266. Determines whether emojis should be rendered by the user's system.
  1267. Not all operating systems support (all) emojis. So alternatively you can let
  1268. Converse render the emojis with `Twemoji <https://twemoji.twitter.com/>`_.
  1269. See also `emoji_image_path`_.
  1270. visible_toolbar_buttons
  1271. -----------------------
  1272. * Default:
  1273. .. code-block:: javascript
  1274. {
  1275. call: false,
  1276. spoiler: false,
  1277. emoji: true,
  1278. toggle_occupants: true
  1279. }
  1280. Allows you to show or hide buttons on the chatboxes' toolbars.
  1281. * *call*:
  1282. Provides a button with a picture of a telephone on it.
  1283. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.
  1284. .. code-block:: javascript
  1285. converse.listen.on('callButtonClicked', function(data) {
  1286. console.log('Strophe connection is', data.connection);
  1287. console.log('Bare buddy JID is', data.model.get('jid'));
  1288. // ... Third-party library code ...
  1289. });
  1290. * *emoji*:
  1291. Enables rendering of emoji and provides a toolbar button for choosing them.
  1292. * *spoiler*:
  1293. Shows a button for showing`XEP-0382 <https://xmpp.org/extensions/xep-0382.html>`_ spoiler messages.
  1294. * *toggle_occupants*:
  1295. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chatroom.
  1296. .. _`websocket-url`:
  1297. websocket_url
  1298. -------------
  1299. * Default: ``undefined``
  1300. Example: ``ws://xmpp.example.com:5280/ws/``
  1301. Example with reverse-proxy and TLS: ``wss://xmpp.example.com/ws/``
  1302. This option is used to specify a
  1303. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  1304. Converse can connect to.
  1305. Websockets provide a more modern and effective two-way communication protocol
  1306. between the browser and a server, effectively emulating TCP at the application
  1307. layer and therefore overcoming many of the problems with existing long-polling
  1308. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  1309. Please refer to your XMPP server's documentation on how to enable websocket
  1310. support.
  1311. .. _`view_mode`:
  1312. view_mode
  1313. ---------
  1314. * Default: ``overlayed``
  1315. * Allowed values: ``overlayed``, ``fullscreen``, ``mobile``, ``embedded``
  1316. The ``view_mode`` setting configures Converse's mode and resulting behavior.
  1317. * ``overlayed`` is the original mode, in which the chats appeared as small boxes overlaying a webpage which can contain arbitrary content.
  1318. * ``fullscreen`` is for a fullpage and single-page app.
  1319. * ``embedded`` is used to embed a single chat into a DOM element in the page. The DOM element must have the id ``#conversejs``.
  1320. * ``mobile`` is for smaller viewports. Converse is responsive, and the other views will also resize to fit a smaller viewport, but certain behavioural changes won't be made. For example, when using ``overlayed`` in a mobile view, Converse won't know which chat is currently visible and therefore won't be able to properly show notifications for chats that are obscured.
  1321. .. note::
  1322. Before the introduction of this setting (in version 3.3.0), there were there
  1323. different builds, each for the different modes.
  1324. These were:
  1325. * ``converse-mobile.js`` for the ``mobile`` mode
  1326. * ``converse-muc-embedded.js`` for embedding a single MUC room into a DOM element with id ``conversejs``
  1327. * ``converse.js`` for the ``overlayed`` mode
  1328. * ``inverse.js`` for the ``fullscreen`` mode
  1329. Besides having different builds, certain plugins had to be whitelisted
  1330. and blacklisted for the different modes.
  1331. ``converse-singleton`` had to be whitelisted for the ``mobile`` and ``fullscreen``
  1332. modes, additionally ``converse-inverse`` had to be whitelisted for the
  1333. ``fullscreen`` mode.
  1334. For both those modes the ``converse-minimize`` and ``converse-dragresize``
  1335. plugins had to be blacklisted.
  1336. When using ``converse-muc-embedded.js`` various plugins also had to manually be
  1337. blacklisted.
  1338. Since version 3.3.0 it's no longer necessary to blacklist any plugins (except
  1339. for ``converse-muc-embedded.js``, which is from version 3.3.3).
  1340. Blacklisting now happens automatically.
  1341. Since version 3.3.0, the ``inverse.js`` and ``converse-mobile.js`` builds no
  1342. longer exist. Instead the standard ``converse.js`` build is used, together with
  1343. the appropriate ``view_mode`` value.
  1344. Since version 4.0.0, there is now also only one CSS file to be used for all
  1345. the different view modes, ``converse.css``.
  1346. The ``converse-muc-embedded.js`` build can still be built, because it's smaller
  1347. than ``converse.js`` due to unused code being removed. It doesn't however contain
  1348. any new code, so the full ``converse.js`` build could be used instead, as long
  1349. as ``view_mode`` is set to ``embedded``.
  1350. Furthermore, it's no longer necessary to whitelist or blacklist any plugins
  1351. when switching view modes.
  1352. .. _`whitelisted_plugins`:
  1353. whitelisted_plugins
  1354. -------------------
  1355. * Default: ``[]``
  1356. A list of plugin names that are whitelisted and will therefore be
  1357. initialized once ``converse.initialize`` is called.
  1358. From Converse 3.0 onwards most of the API is available only to plugins and
  1359. all plugins need to be whitelisted first.
  1360. This is done to prevent malicious scripts from using the API to trick users or
  1361. to read their conversations.
  1362. By default all the core plugins are already whitelisted.
  1363. These are::
  1364. converse-bookmarks
  1365. converse-chatboxes
  1366. converse-chatview
  1367. converse-controlbox
  1368. converse-core
  1369. converse-disco
  1370. converse-dragresize
  1371. converse-fullscreen
  1372. converse-headline
  1373. converse-mam
  1374. converse-minimize
  1375. converse-muc
  1376. converse-muc-embedded
  1377. converse-notification
  1378. converse-ping
  1379. converse-profile
  1380. converse-register
  1381. converse-roomslist
  1382. converse-rosterview
  1383. converse-singleton
  1384. converse-spoilers
  1385. converse-vcard'
  1386. .. note::
  1387. If you are using a custom build which excludes some core plugins, then you
  1388. should blacklist them so that malicious scripts can't register their own
  1389. plugins under those names. See `blacklisted_plugins`_ for more info.
  1390. Example:
  1391. .. code-block:: javascript
  1392. require(['converse-core', 'converse-muc-embedded'], function (converse) {
  1393. converse.initialize({
  1394. // other settings removed for brevity
  1395. whitelisted_plugins: ['myplugin']
  1396. });
  1397. });
  1398. xhr_user_search_url
  1399. -------------------
  1400. .. note::
  1401. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous JavaScript and XML).
  1402. * Default: ``null``
  1403. There are two ways to add users.
  1404. * The user inputs a valid JID (Jabber ID, aka XMPP address), and the user is added as a pending contact.
  1405. * The user inputs some text (for example part of a first name or last name),
  1406. an XHR (Ajax Request) will be made to a remote server, and a list of matches are returned.
  1407. The user can then choose one of the matches to add as a contact.
  1408. By providing an XHR search URL, you're enabling the second mechanism.
  1409. *What is expected from the remote server?*
  1410. A default JSON encoded list of objects must be returned. Each object
  1411. corresponds to a matched user and needs the keys ``jid`` and ``fullname``.
  1412. .. code-block:: javascript
  1413. [{"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, {"jid": "doc@brown.com", "fullname": "Doc Brown"}]
  1414. .. note::
  1415. Make sure your server script sets the header `Content-Type: application/json`.
  1416. This is the URL to which an XHR GET request will be made to fetch user data from your remote server.
  1417. The query string will be included in the request with ``q`` as its key.
  1418. The data returned must be a JSON encoded list of user JIDs.
  1419. .. note::
  1420. Converse will construct the XHR get URL by simply appending
  1421. ``q=<query string entered>`` to the URL given by ``xhr_user_search_url``.
  1422. It is therefore important that the necessary question mark (``?``) preceding the
  1423. URL's query component or necessary delimiters (``&``) are included. See valid
  1424. examples below.
  1425. Examples:
  1426. .. code-block:: javascript
  1427. xhr_user_search_url: 'https://some.url/some_path?',
  1428. xhr_user_search_url: 'https://some.url/some_path?api_key=somekey&',