quickstart.rst 2.2 KB

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