configuration.rst 64 KB

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