configuration.rst 48 KB

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