quickstart.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. =========================================
  2. Quickstart (to get a demo up and running)
  3. =========================================
  4. When you download a specific release of *Converse.js* there will be two minified files inside the zip file.
  5. * builds/converse.min.js
  6. * css/converse.min.css
  7. You can include these two files inside the *<head>* element of your website via the *script* and *link*
  8. tags:
  9. .. code-block:: html
  10. <link rel="stylesheet" type="text/css" media="screen" href="css/converse.min.css">
  11. <script src="builds/converse.min.js"></script>
  12. You need to initialize Converse.js with configuration settings according to
  13. your requirements.
  14. Please refer to the :ref:`configuration-variables` section further below for info on
  15. all the available configuration settings.
  16. To configure Converse.js, put the following inline Javascript code at the
  17. bottom of your page (after the closing *</body>* element).
  18. .. code-block:: javascript
  19. require(['converse'], function (converse) {
  20. converse.initialize({
  21. auto_list_rooms: false,
  22. auto_subscribe: false,
  23. bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
  24. hide_muc_server: false,
  25. i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
  26. prebind: false,
  27. show_controlbox_by_default: true,
  28. roster_groups: true
  29. });
  30. });
  31. The `index.html <https://github.com/jcbrand/converse.js/blob/master/index.html>`_ file inside the
  32. Converse.js repository may serve as a nice usable example.
  33. These minified files provide the same demo-like functionality as is available
  34. on the `conversejs.org <http://conversejs.org>`_ website. Useful for testing or demoing.
  35. You'll most likely want to implement some kind of single persistent session solution for
  36. your website, where users authenticate once in your website and then stay
  37. logged in to their XMPP session upon the next page reload.
  38. For more info on this, read: :ref:`session-support`.
  39. You might also want to have more fine-grained control of what gets included in
  40. the minified Javascript file. Read :doc:`builds` for more info on how to do that.