configuration.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080
  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. .. contents:: Table of Contents
  7. :depth: 2
  8. :local:
  9. The included minified JS and CSS files can be used for demoing or testing, but
  10. you'll want to configure *Converse.js* to suit your needs before you deploy it
  11. on your website.
  12. *Converse.js* is passed its configuration settings when you call its *initialize* method.
  13. You'll most likely want to call the *initialize* method in your HTML page. For
  14. an example of how this is done, please see the bottom of the *./index.html* page.
  15. Please refer to the `Configuration variables`_ section below for info on
  16. all the available configuration settings.
  17. After you have configured *Converse.js*, you'll have to regenerate the minified
  18. JS file so that it will include the new settings. Please refer to the
  19. :ref:`minification` section for more info on how to do this.
  20. .. _`configuration-variables`:
  21. Configuration variables
  22. =======================
  23. authentication
  24. --------------
  25. * Default: ``login``
  26. * Allowed values: `login`_, `anonymous`_, `prebind`_
  27. This option states the way converse.js will authenticate.
  28. login
  29. ~~~~~
  30. The default means is ``login``, which means that the user either logs in manually with their
  31. username and password, or automatically if used together with ``auto_login=true``
  32. and ``jid`` and ``password`` values. See `auto_login`_.
  33. anonymous
  34. ~~~~~~~~~
  35. This enables anonymous login if the XMPP server supports it. This option can be
  36. used together with `auto_login`_ to automatically and anonymously log a user in
  37. as soon as the page loads.
  38. The server's domain is passed in via the `jid`_ setting.
  39. prebind
  40. ~~~~~~~
  41. See also: :ref:`session-support`
  42. Use this option when you want to attach to an existing XMPP
  43. `BOSH <https://en.wikipedia.org/wiki/BOSH>`_ session.
  44. Usually a BOSH session is set up server-side in your web app.
  45. Attaching to an existing BOSH session that was set up server-side is useful
  46. when you want to maintain a persistent single session for your users instead of
  47. requiring them to log in manually.
  48. When a BOSH session is initially created, you'll receive three tokens.
  49. A JID (jabber ID), SID (session ID) and RID (Request ID).
  50. Converse.js needs these tokens in order to attach to that same session.
  51. There are two complementary configuration settings to ``prebind``.
  52. They are :ref:`keepalive` and `prebind_url`_.
  53. ``keepalive`` can be used keep the session alive without having to pass in
  54. new RID and SID tokens to ``converse.initialize`` every time you reload the page.
  55. This removes the need to set up a new BOSH session every time a page loads.
  56. You do however still need to supply the user's JID so that converse.js can be
  57. sure that the session it's resuming is for the right user.
  58. `prebind_url`_ lets you specify a URL which converse.js will call whenever a
  59. new BOSH session needs to be set up.
  60. Here's an example of converse.js being initialized with these three options:
  61. .. code-block:: javascript
  62. converse.initialize({
  63. bosh_service_url: 'https://bind.example.com',
  64. keepalive: true,
  65. jid: 'me@example.com',
  66. authentication: 'prebind',
  67. prebind_url: 'http://example.com/api/prebind',
  68. allow_logout: false
  69. });
  70. allow_chat_pending_contacts
  71. ---------------------------
  72. * Default: ``false``
  73. Allow the user to chat with pending contacts.
  74. allow_contact_removal
  75. ---------------------
  76. * Default: ``true``
  77. Allow the user to remove roster contacts by clicking on the delete icon
  78. (i.e. traschcan) next to a contact's name in the roster.
  79. allow_contact_requests
  80. ----------------------
  81. * Default: ``true``
  82. Allow users to add one another as contacts. If this is set to false, the
  83. **Add a contact** widget, **Contact Requests** and **Pending Contacts** roster
  84. sections will all not appear. Additionally, all incoming contact requests will be
  85. ignored.
  86. allow_dragresize
  87. ----------------
  88. * Default: ``true``
  89. Allow users to resize chats by dragging the edges. The min-height and min-width
  90. CSS properties set on a chat boxes (specifically on the ``#converse.js .chatbox > .box-flyout`` element)
  91. will be honored, IF they are set in pixels.
  92. allow_muc
  93. ---------
  94. * Default: ``true``
  95. Allow multi-user chat (muc) in chatrooms. Setting this to ``false`` will remove
  96. the ``Chatrooms`` tab from the control box.
  97. allow_muc_invitations
  98. ---------------------
  99. * Default: ``true``
  100. Allows users to be invited to join MUC chat rooms. An "Invite" widget will
  101. appear in the sidebar of the chat room where you can type in the JID of a user
  102. to invite into the chat room.
  103. allow_otr
  104. ---------
  105. * Default: ``true``
  106. Allow Off-the-record encryption of single-user chat messages.
  107. allow_registration
  108. ------------------
  109. * Default: ``true``
  110. Support for `XEP-0077: In band registration <http://xmpp.org/extensions/xep-0077.html>`_
  111. Allow XMPP account registration showing the corresponding UI register form interface.
  112. animate
  113. -------
  114. * Default: ``true``
  115. Show animations, for example when opening and closing chat boxes.
  116. archived_messages_page_size
  117. ---------------------------
  118. * Default: ``20``
  119. See also: `message_archiving`_
  120. This feature applies to `XEP-0313: Message Archive Management (MAM) <https://xmpp.org/extensions/xep-0313.html>`_
  121. and will only take effect if your server supports MAM.
  122. It allows you to specify the maximum amount of archived messages to be returned per query.
  123. When you open a chat box or room, archived messages will be displayed (if
  124. available) and the amount returned will be no more than the page size.
  125. You will be able to query for even older messages by scrolling upwards in the chat box or room
  126. (the so-called infinite scrolling pattern).
  127. auto_list_rooms
  128. ---------------
  129. * Default: ``false``
  130. If true, and the XMPP server on which the current user is logged in supports
  131. multi-user chat, then a list of rooms on that server will be fetched.
  132. Not recommended for servers with lots of chat rooms.
  133. For each room on the server a query is made to fetch further details (e.g.
  134. features, number of occupants etc.), so on servers with many rooms this
  135. option will create lots of extra connection traffic.
  136. auto_login
  137. ----------
  138. * Default: ``false``
  139. This option can be used to let converse.js automatically log the user in as
  140. soon as the page loads.
  141. It should be used either with ``authentication`` set to ``anonymous`` or to ``login``.
  142. If ``authentication`` is set to ``login``, then you will also need to provide a
  143. valid ``jid`` and ``password`` values.
  144. If ``authentication`` is set to ``anonymous``, then you will also need to provide the
  145. server's domain via the `jid`_ setting.
  146. This is a useful setting if you'd like to create a custom login form in your
  147. website. You'll need to write some Javascript to accept that custom form's
  148. login credentials, then you can pass those credentials (``jid`` and
  149. ``password``) to ``converse.initialize`` to start converse.js and log the user
  150. into their XMPP account.
  151. auto_away
  152. ---------
  153. * Default: ``0``
  154. The amount of seconds after which the user's presence status should
  155. automatically become ``away``.
  156. If the user's status is ``extended away``, it won't be changed to ``away``.
  157. If the given value is negative or ``0``, this option is disabled.
  158. auto_xa
  159. -------
  160. * Default: ``0``
  161. The amount of seconds after which the user's presence status should
  162. automatically become ``extended away``.
  163. If the value is negative or ``0``, the function is disabled.
  164. auto_reconnect
  165. --------------
  166. * Default: ``true``
  167. Automatically reconnect to the XMPP server if the connection drops
  168. unexpectedly.
  169. This option works best when you have `authentication` set to `prebind` and have
  170. also specified a `prebind_url` URL, from where converse.js can fetch the BOSH
  171. tokens. In this case, converse.js will automaticallly reconnect when the
  172. connection drops but also reestablish earlier lost connections (due to
  173. network outages, closing your laptop etc.).
  174. When `authentication` is set to `login`, then this option will only work when
  175. the page hasn't been reloaded yet, because then the user's password has been
  176. wiped from memory. This configuration can however still be useful when using
  177. converse.js in desktop apps, for example those based on `CEF <https://bitbucket.org/chromiumembedded/cef>`_
  178. or `electron <http://electron.atom.io/>`_.
  179. auto_subscribe
  180. --------------
  181. * Default: ``false``
  182. If true, the user will automatically subscribe back to any contact requests.
  183. auto_join_on_invite
  184. -------------------
  185. * Default: ``false``
  186. If true, the user will automatically join a chatroom on invite without any confirm.
  187. auto_join_rooms
  188. ---------------
  189. * Default: ``[]``
  190. This settings allows you to provide a list of groupchat conversations to be
  191. automatically joined once the user has logged in.
  192. You can either specify a simple list of room JIDs, in which case your nickname
  193. will be taken from your JID, or you can specify a list of maps, where each map
  194. specifies the room's JID and the nickname that should be used.
  195. For example:
  196. `[{'jid': 'room@example.org', 'nick': 'WizardKing69' }]`
  197. .. _`bosh-service-url`:
  198. bosh_service_url
  199. ----------------
  200. * Default: ``undefined``
  201. To connect to an XMPP server over HTTP you need a `BOSH <https://en.wikipedia.org/wiki/BOSH>`_
  202. connection manager which acts as a middle man between the HTTP and XMPP
  203. protocols.
  204. The bosh_service_url setting takes the URL of a BOSH connection manager.
  205. Please refer to your XMPP server's documentation on how to enable BOSH.
  206. 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>`_
  207. A more modern alternative to BOSH is to use `websockets <https://developer.mozilla.org/en/docs/WebSockets>`_.
  208. Please see the :ref:`websocket-url` configuration setting.
  209. cache_otr_key
  210. -------------
  211. * Default: ``false``
  212. Let the `OTR (Off-the-record encryption) <https://otr.cypherpunks.ca>`_ private
  213. key be cached in your browser's session storage.
  214. The browser's session storage persists across page loads but is deleted once
  215. the tab or window is closed.
  216. If this option is set to ``false``, a new OTR private key will be generated
  217. for each page load. While more inconvenient, this is a much more secure option.
  218. This setting can only be used together with ``allow_otr = true``.
  219. .. note::
  220. A browser window's session storage is accessible by all javascript that
  221. is served from the same domain. So if there is malicious javascript served by
  222. the same server (or somehow injected via an attacker), then they will be able
  223. to retrieve your private key and read your all the chat messages in your
  224. current session. Previous sessions however cannot be decrypted.
  225. chatstate_notification_blacklist
  226. --------------------------------
  227. * Default: ``[]``
  228. A list of JIDs to be ignored when showing desktop notifications of changed chat states.
  229. Some user's clients routinely connect and disconnect (likely on mobile) and
  230. each time a chat state notificaion is received (``online`` when connecting and
  231. then ``offline`` when disconnecting).
  232. When desktop notifications are turned on (see `show-desktop-notifications`_),
  233. then you'll receive notification messages each time this happens.
  234. Receiving constant notifications that a user's client is connecting and disconnecting
  235. is annoying, so this option allows you to ignore those JIDs.
  236. credentials_url
  237. ---------------
  238. * Default: ``null``
  239. * Type: URL
  240. This setting should be used in conjunction with ``authentication`` set to ``login`` and :ref:`keepalive` set to ``true``.
  241. It allows you to specify a URL which converse.js will call when it needs to get
  242. the username and password (or authentication token) which converse.js will use
  243. to automatically log the user in.
  244. The server behind ``credentials_url`` should return a JSON encoded object::
  245. {
  246. "jid": "me@example.com/resource",
  247. "password": "Ilikecats!",
  248. }
  249. csi_waiting_time
  250. ----------------
  251. * Default: ``0``
  252. This option adds support for `XEP-0352 Client State Indication <http://xmpp.org/extensions/xep-0352.html>_`
  253. If converse.js is idle for the configured amount of seconds, a chat state
  254. indication of ``inactive`` will be sent out to the XMPP server (if the server
  255. supports CSI).
  256. Afterwards, ss soon as there is any activity (for example, the mouse moves),
  257. a chat state indication of ``active`` will be sent out.
  258. A value of ``0`` means that this feature is disabled.
  259. debug
  260. -----
  261. * Default: ``false``
  262. If set to true, debugging output will be logged to the browser console.
  263. default_domain
  264. --------------
  265. * Default: ``undefined``
  266. Specify a domain to act as the default for user JIDs. This allows users to log
  267. in with only the username part of their JID, instead of the full JID.
  268. For example, if ``default_domain`` is ``example.org``, then the user:
  269. ``johnny@example.org`` can log in with only ``johnny``.
  270. JIDs with other domains are still allowed but need to be provided in full.
  271. To specify only one domain and disallow other domains, see the `locked_domain`_
  272. option.
  273. default_state
  274. -------------
  275. * Default: ``'online'``
  276. The default chat status that the user wil have. If you for example set this to
  277. ``'chat'``, then converse.js will send out a presence stanza with ``"show"``
  278. set to ``'chat'`` as soon as you've been logged in.
  279. domain_placeholder
  280. ------------------
  281. * Default: ``e.g. conversejs.org``
  282. The placeholder text shown in the domain input on the registration form.
  283. expose_rid_and_sid
  284. ------------------
  285. * Default: ``false``
  286. Allow the prebind tokens, RID (request ID) and SID (session ID), to be exposed
  287. globally via the API. This allows other scripts served on the same page to use
  288. these values.
  289. *Beware*: a malicious script could use these tokens to assume your identity
  290. and inject fake chat messages.
  291. filter_by_resource
  292. ------------------
  293. * Default: ``false``
  294. Before version 1.0.3 converse.js would ignore received messages if they were
  295. intended for a different resource then the current user had. It was decided to
  296. drop this restriction but leave it configurable.
  297. forward_messages
  298. ----------------
  299. * Default: ``false``
  300. If set to ``true``, sent messages will also be forwarded to the sending user's
  301. bare JID (their Jabber ID independent of any chat clients aka resources).
  302. This means that sent messages are visible from all the user's chat clients,
  303. and not just the one from which it was actually sent.
  304. This is especially important for web chat, such as converse.js, where each
  305. browser tab functions as a separate chat client, with its own resource.
  306. This feature uses Stanza forwarding, see also `XEP 0297: Stanza Forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  307. For an alternative approach, see also `message_carbons`_.
  308. fullname
  309. --------
  310. If you are using prebinding, can specify the fullname of the currently
  311. logged in user, otherwise the user's vCard will be fetched.
  312. hide_muc_server
  313. ---------------
  314. * Default: ``false``
  315. Hide the ``server`` input field of the form inside the ``Room`` panel of the
  316. controlbox. Useful if you want to restrict users to a specific XMPP server of
  317. your choosing.
  318. hide_offline_users
  319. ------------------
  320. * Default: ``false``
  321. If set to ``true``, then don't show offline users.
  322. include_offline_state
  323. ---------------------
  324. * Default: `false`
  325. Originally, converse.js included an `offline` state which the user could
  326. choose (along with `online`, `busy` and `away`).
  327. Eventually it was however decided to remove this state, since the `offline`
  328. state doesn't propagate across tabs like the others do.
  329. What's meant by "propagate across tabs", is that when you set the state to
  330. `offline` in one tab, and you have instances of converse.js open in other tabs
  331. in your browser, then those instances will not have their states changed to
  332. `offline` as well. For the other statees the change is however propagated.
  333. The reason for this is that according to the XMPP spec, there is no `offline`
  334. state. The only defined states are:
  335. * away -- The entity or resource is temporarily away.
  336. * chat -- The entity or resource is actively interested in chattiIng.
  337. * dnd -- The entity or resource is busy (dnd = "Do Not Disturb").
  338. * xa -- The entity or resource is away for an extended period (xa = "eXtended Away").
  339. Read the [relevant section in the XMPP spec](https://xmpp.org/rfcs/rfc6121.html#presence-syntax-children-show) for more info.
  340. What used to happen in converse.js when the `offline` state was chosen, is
  341. that a presence stanza with a `type` of `unavailable` was sent out.
  342. This is actually exactly what happens when you log out of converse.js as well,
  343. with the notable exception that in the `offline` state, the connection is not
  344. terminated. So you can at any time change your state to something else and
  345. start chatting again.
  346. This might be useful to people, however the fact that the `offline` state
  347. doesn't propagate across tabs means that the user experience is inconsistent,
  348. confusing and appears "broken".
  349. If you are however aware of this issue and still want to allow the `offline`
  350. state, then you can set this option to `true` to enable it.
  351. i18n
  352. ----
  353. * Default: Auto-detection of the User/Browser language
  354. If no locale is matching available locales, the default is ``en``.
  355. Specify the locale/language. The language must be in the ``locales`` object. Refer to
  356. ``./locale/locales.js`` to see which locales are supported.
  357. jid
  358. ---
  359. The Jabber ID or "JID" of the current user. The JID uniquely identifies a user
  360. on the XMPP network. It looks like an email address, but it's used for instant
  361. messaging instead.
  362. This value needs to be provided when using the :ref:`keepalive` option together
  363. with `prebind`_.
  364. .. _`keepalive`:
  365. keepalive
  366. ---------
  367. * Default: ``true``
  368. Determines whether Converse.js will maintain the chat session across page
  369. loads.
  370. This setting should also be used in conjunction with ``authentication`` set to `prebind`_.
  371. When using ``keepalive`` and ``prebind``, you will have to provide the `jid`_
  372. of the current user to ensure that a cached session is only resumed if it
  373. belongs to the current user.
  374. See also:
  375. * :ref:`session-support`
  376. .. note::
  377. Currently the "keepalive" setting only works with BOSH and not with
  378. websockets. This is because XMPP over websocket does not use the same
  379. session token as with BOSH. A possible solution for this is to implement
  380. `XEP-0198 <http://xmpp.org/extensions/xep-0198.html>`_, specifically
  381. with regards to "stream resumption".
  382. locked_domain
  383. -------------
  384. * Default: ``undefined``
  385. Similar to `default_domain`_ but no other domains are allowed.
  386. message_archiving
  387. -----------------
  388. * Default: ``never``
  389. Provides support for `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  390. whereby messages are archived in the XMPP server for later retrieval. Note, your XMPP server must support
  391. XEP-0313 MAM for this to work.
  392. This option sets the default archiving preference. Valid values are ``never``, ``always`` and ``roster``.
  393. ``roster`` means that only messages to and from JIDs in your roster will be
  394. archived. The other two values are self-explanatory.
  395. message_archiving_timeout
  396. -------------------------
  397. * Default: ``8000``
  398. The amount of time (in milliseconds) to wait when requesting archived messages
  399. from the XMPP server.
  400. Used in conjunction with `message_archiving` and in context of `XEP-0313: Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_.
  401. message_carbons
  402. ---------------
  403. * Default: ``false``
  404. Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html>`_
  405. In order to keep all IM clients for a user engaged in a conversation,
  406. outbound messages are carbon-copied to all interested resources.
  407. This is especially important in webchat, like converse.js, where each browser
  408. tab serves as a separate IM client.
  409. Both message_carbons and `forward_messages`_ try to solve the same problem
  410. (showing sent messages in all connected chat clients aka resources), but go about it
  411. in two different ways.
  412. Message carbons is the XEP (Jabber protocol extension) specifically drafted to
  413. solve this problem, while `forward_messages`_ uses
  414. `stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
  415. message_storage
  416. ----------------
  417. * Default: ``session``
  418. Valid options: ``session``, ``local``.
  419. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  420. (``localStorage`` or ``sessionStorage``) used by converse.js to cache messages (private and group).
  421. The main difference between the two is that `sessionStorage` only persists while
  422. the current tab or window containing a converse.js instance is open. As soon as
  423. it's closed, the data is cleared.
  424. Data in `localStorage` on the other hand is kept indefinitely, which can have
  425. privacy implications on public computers or when multiple people are using the
  426. same computer.
  427. See also the `storage`_ option, which applies to other cached data, such as
  428. which chats you have open, what features the XMPP server supports and what
  429. your online status is.
  430. muc_history_max_stanzas
  431. -----------------------
  432. * Default: ``undefined``
  433. This option allows you to specify the maximum amount of messages to be shown in a
  434. chat room when you enter it. By default, the amount specified in the room
  435. configuration or determined by the server will be returned.
  436. Please note, this option is not related to
  437. `XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
  438. which also allows you to show archived chat room messages, but follows a
  439. different approach.
  440. If you're using MAM for archiving chat room messages, you might want to set
  441. this option to zero.
  442. muc_instant_rooms
  443. ------------------
  444. * Default: ``true``
  445. Determines whether 'instant' (also called 'dynamic' in OpenFire) rooms are created.
  446. Otherwise rooms first have to be configured before they're available to other
  447. users (so-called "registered rooms" in `MUC-0045 <http://xmpp.org/extensions/xep-0045.html#createroom>`_).
  448. From a UX perspective, if this settings is `false`, then a configuration form will
  449. render, that has to be filled in first, before the room can be joined by other
  450. users.
  451. muc_nickname_from_jid
  452. ---------------------
  453. * Default: ``false``
  454. When set to ``true``, then users will not be prompted to provide nicknames for
  455. chat rooms. Instead, the node part of a user's JID (i.e. JID = node@domain/resource)
  456. will be used. If the user's nickname is already taken by another user in the
  457. chat room, then an integer will be added to make it unique.
  458. So, for example, if john@example.com joins a chatroom, his nickname will
  459. automatically be "john". If now john@differentdomain.com tries to join the
  460. room, his nickname will be "john-2", and if john@somethingelse.com joins, then
  461. his nickname will be "john-3", and so forth.
  462. notify_all_room_messages
  463. ------------------------
  464. * Default: ``false``
  465. By default, sound and desktop notifications will only be made when you are
  466. mentioned in a room. If you set this setting to `true`, then you will be
  467. notified of all messages received in a room.
  468. You can also pass an array of room JIDs to this option, to only apply it to
  469. certain rooms.
  470. notification_icon
  471. -----------------
  472. * Default: ``'/logo/conversejs.png'``
  473. This option specifies which icon is shown in HTML5 notifications, as provided
  474. by the ``src/converse-notification.js`` plugin.
  475. ping_interval
  476. -------------
  477. * Default: ``180``
  478. Make ping to server in order to keep connection with server killing sessions after idle timeout.
  479. The ping are sent only if no messages are sent in the last ``ping_interval`` seconds
  480. You need to set the value to any positive value to enable this functionality.
  481. If you set this value to ``0`` or any negative value, il will disable this functionality.
  482. .. _`play-sounds`:
  483. play_sounds
  484. -----------
  485. * Default: ``false``
  486. Plays a notification sound when you receive a personal message or when your
  487. nickname is mentioned in a chat room.
  488. Inside the ``./sounds`` directory of the Converse.js repo you'll see MP3 and Ogg
  489. formatted sound files. We need both, because neither format is supported by all browsers.
  490. You can set the URL where the sound files are hosted with the `sounds_path`_
  491. option.
  492. Requires the `src/converse-notification.js` plugin.
  493. .. _`prebind_url`:
  494. prebind_url
  495. -----------
  496. * Default: ``null``
  497. * Type: URL
  498. See also: :ref:`session-support`
  499. This setting should be used in conjunction with ``authentication`` set to `prebind` and :ref:`keepalive` set to ``true``.
  500. It allows you to specify a URL which converse.js will call when it needs to get
  501. the RID and SID (Request ID and Session ID) tokens of a BOSH connection, which
  502. converse.js will then attach to.
  503. The server behind ``prebind_url`` should return a JSON encoded object with the
  504. three tokens::
  505. {
  506. "jid": "me@example.com/resource",
  507. "sid": "346234623462",
  508. "rid": "876987608760"
  509. }
  510. providers_link
  511. --------------
  512. * Default: ``https://xmpp.net/directory.php``
  513. The hyperlink on the registration form which points to a directory of public
  514. XMPP servers.
  515. roster_groups
  516. -------------
  517. * Default: ``false``
  518. If set to ``true``, converse.js will show any roster groups you might have
  519. configured.
  520. .. note::
  521. It's currently not possible to use converse.js to assign contacts to groups.
  522. Converse.js can only show users and groups that were previously configured
  523. elsewhere.
  524. show_controlbox_by_default
  525. --------------------------
  526. * Default: ``false``
  527. The "controlbox" refers to the special chatbox containing your contacts roster,
  528. status widget, chatrooms and other controls.
  529. By default this box is hidden and can be toggled by clicking on any element in
  530. the page with class *toggle-controlbox*.
  531. If this options is set to true, the controlbox will by default be shown upon
  532. page load.
  533. However, be aware that even if this value is set to ``false``, if the
  534. controlbox is open, and the page is reloaded, then it will stay open on the new
  535. page as well.
  536. .. _`show-desktop-notifications`:
  537. show_desktop_notifications
  538. --------------------------
  539. * Default: ``true``
  540. Should HTML5 desktop notifications be shown?
  541. Notification will be shown in the following cases:
  542. * the browser is not visible nor focused and a private message is received.
  543. * the browser is not visible nor focused and a groupchat message is received which mentions you.
  544. * `auto_subscribe` is set to `false` and a new contact request is received.
  545. Requires the `src/converse-notification.js` plugin.
  546. show_only_online_users
  547. ----------------------
  548. * Default: ``false``
  549. If set to ``true``, only online users will be shown in the contacts roster.
  550. Users with any other status (e.g. away, busy etc.) will not be shown.
  551. sounds_path
  552. -----------
  553. * Default: ``/sounds/``
  554. This option only makes sense in conjunction with the `play_sounds`_ option and
  555. specifies the URL of the sound files to be played (exluding the file names
  556. themselves).
  557. In order to support all browsers we need both an MP3 and an Ogg file. Make sure
  558. to name your files ``msg_received.ogg`` and ``msg_received.mp3``.
  559. storage
  560. -------
  561. * Default: ``session``
  562. Valid options: ``session``, ``local``.
  563. This option determines the type of `browser storage <https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage>`_
  564. (``localStorage`` or ``sessionStorage``) used by converse.js to cache user data.
  565. Originally converse.js used only `localStorage`, however `sessionStorage` is from a
  566. privacy perspective a better choice.
  567. The main difference between the two is that `sessionStorage` only persists while
  568. the current tab or window containing a converse.js instance is open. As soon as
  569. it's closed, the data is cleared.
  570. Data in `localStorage` on the other hand is kept indefinitely.
  571. The data that is cached includes which chats you had open, what features the
  572. XMPP server supports and what your online status was.
  573. Since version 1.0.7, the store for messages is now configurable separately with
  574. the `message_storage`_ option, to allow you to cache messages for longer in the
  575. browser (with `localStorage`) while still using `sessionStorage` for other
  576. data.
  577. .. note::
  578. Between versions 0.8.0 and 1.0.7, setting the value of this option to "local"
  579. is not recommended. The statuses (online, away, busy etc.) of your roster
  580. contacts are cached in the browser storage. If you use local storage, these
  581. values are stored for multiple sessions, and they will likely become out of
  582. sync with your contacts' actual statuses. The session storage doesn't have
  583. this problem, because roster contact statuses will not become out of sync in
  584. a single session, only across more than one session.
  585. Since version 1.0.7, the "storage" option doesn't apply anymore to how roster
  586. contacts and their statuses are stored (they're now always stored in session
  587. storage), to address the above issue.
  588. sticky_controlbox
  589. -----------------
  590. * Default: ``false``
  591. If set to ``true``, the control box (which includes the login, registration,
  592. contacts and rooms tabs) will not be closeable. It won't have a close button at
  593. all.
  594. The idea behind this setting is to provide a better experience on mobile
  595. devices when the intent is to use converse.js as a web app. In this case
  596. it doesn't make sense to close the control box, as there's often then nothing
  597. "behind" it that's relevant to the user.
  598. strict_plugin_dependencies
  599. --------------------------
  600. * Default: ``false``
  601. When set to ``true`` and a plugin tries to override an object which doesn't
  602. exist (for example because the plugin which provides that object is not
  603. loaded), then an error will be raised.
  604. Otherwise a message will simply be logged and the override instruction ignored.
  605. This allows plugins to have "soft" dependencies which aren't declared as
  606. as dependencies.
  607. synchronize_availability
  608. --------------------
  609. * Default: ``true``
  610. Valid options: ``true``, ``false``, ``a resource name``.
  611. This option lets you synchronize your chat status (`online`, `busy`, `away`) with other chat clients. In other words,
  612. if you change your status to `busy` in a different chat client, your status will change to `busy` in converse.js as well.
  613. If set to ``true``, converse.js will synchronize with all other clients you are logged in with.
  614. If set to ``false``, this feature is disabled.
  615. If set to ``a resource name``, converse.js will synchronize only with a client that has that particular resource assigned to it.
  616. use_otr_by_default
  617. ------------------
  618. * Default: ``false``
  619. If set to ``true``, Converse.js will automatically try to initiate an OTR (off-the-record)
  620. encrypted chat session every time you open a chat box.
  621. use_vcards
  622. ----------
  623. * Default: ``true``
  624. Determines whether the XMPP server will be queried for roster contacts' VCards
  625. or not. VCards contain extra personal information such as your fullname and
  626. avatar image.
  627. visible_toolbar_buttons
  628. -----------------------
  629. * Default:
  630. .. code-block:: javascript
  631. {
  632. call: false,
  633. clear: true,
  634. emoticons: true,
  635. toggle_occupants: true
  636. }
  637. Allows you to show or hide buttons on the chat boxes' toolbars.
  638. * *call*:
  639. Provides a button with a picture of a telephone on it.
  640. When the call button is pressed, it will emit an event that can be used by a third-party library to initiate a call.::
  641. converse.listen.on('callButtonClicked', function(event, data) {
  642. console.log('Strophe connection is', data.connection);
  643. console.log('Bare buddy JID is', data.model.get('jid'));
  644. // ... Third-party library code ...
  645. });
  646. * *clear*:
  647. Provides a button for clearing messages from a chat box.
  648. * *emoticons*:
  649. Enables rendering of emoticons and provides a toolbar button for choosing them.
  650. * toggle_occupants:
  651. Shows a button for toggling (i.e. showing/hiding) the list of occupants in a chat room.
  652. .. _`websocket-url`:
  653. websocket_url
  654. -------------
  655. * Default: ``undefined``
  656. This option is used to specify a
  657. `websocket <https://developer.mozilla.org/en/docs/WebSockets>`_ URI to which
  658. converse.js can connect to.
  659. Websockets provide a more modern and effective two-way communication protocol
  660. between the browser and a server, effectively emulating TCP at the application
  661. layer and therefore overcoming many of the problems with existing long-polling
  662. techniques for bidirectional HTTP (such as `BOSH <https://en.wikipedia.org/wiki/BOSH>`_).
  663. Please refer to your XMPP server's documentation on how to enable websocket
  664. support.
  665. .. note::
  666. Please note that not older browsers do not support websockets. For older
  667. browsers you'll want to specify a BOSH URL. See the :ref:`bosh-service-url`
  668. configuration setting).
  669. .. note::
  670. Converse.js does not yet support "keepalive" with websockets.
  671. xhr_custom_status
  672. -----------------
  673. * Default: ``false``
  674. .. note::
  675. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous Javascript and XML).
  676. This option will let converse.js make an AJAX POST with your changed custom chat status to a
  677. remote server.
  678. xhr_custom_status_url
  679. ---------------------
  680. .. note::
  681. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous Javascript and XML).
  682. * Default: Empty string
  683. Used only in conjunction with ``xhr_custom_status``.
  684. This is the URL to which the AJAX POST request to set the user's custom status
  685. message will be made.
  686. The message itself is sent in the request under the key ``msg``.
  687. xhr_user_search
  688. ---------------
  689. * Default: ``false``
  690. .. note::
  691. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous Javascript and XML).
  692. There are two ways to add users.
  693. * The user inputs a valid JID (Jabber ID), and the user is added as a pending contact.
  694. * The user inputs some text (for example part of a firstname or lastname), an XHR (Ajax Request) will be made to a remote server, and a list of matches are returned. The user can then choose one of the matches to add as a contact.
  695. This setting enables the second mechanism, otherwise by default the first will be used.
  696. *What is expected from the remote server?*
  697. A default JSON encoded list of objects must be returned. Each object
  698. corresponds to a matched user and needs the keys ``id`` and ``fullname``.
  699. .. note::
  700. Make sure your server script sets the header `Content-Type: application/json`.
  701. xhr_user_search_url
  702. -------------------
  703. .. note::
  704. XHR stands for XMLHTTPRequest, and is meant here in the AJAX sense (Asynchronous Javascript and XML).
  705. * Default: Empty string
  706. Used only in conjunction with ``xhr_user_search``.
  707. This is the URL to which an XHR GET request will be made to fetch user data from your remote server.
  708. The query string will be included in the request with ``q`` as its key.
  709. The data returned must be a JSON encoded list of user JIDs.