2
0

quickstart.rst 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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
  5. ==========
  6. Getting a demo up and running
  7. =============================
  8. Use the content delivery network
  9. --------------------------------
  10. Converse has a `CDN <https://en.wikipedia.org/wiki/Content_delivery_network>`_, provided by `KeyCDN <http://keycdn.com/>`_,
  11. which hosts its JavaScript and CSS files.
  12. The latest versions of these files are available at these URLs:
  13. * https://cdn.conversejs.org/dist/converse.min.js
  14. * https://cdn.conversejs.org/css/converse.min.css
  15. It's however recommended that you load a specific version of Converse, to avoid
  16. breakage when a new version is released and the above URLs load new resources.
  17. To load a specific version of Converse you can put the version in the URL, like so:
  18. * https://cdn.conversejs.org/4.0.0/dist/converse.min.js
  19. * https://cdn.conversejs.org/4.0.0/css/converse.min.css
  20. You can include these two URLs inside the *<head>* element of your website
  21. via the *script* and *link* tags:
  22. .. code-block:: html
  23. <link rel="stylesheet" type="text/css" media="screen" href="https://cdn.conversejs.org/css/converse.min.css">
  24. <script src="https://cdn.conversejs.org/dist/converse.min.js" charset="utf-8"></script>
  25. .. note:: Instead of always loading the latest version of Converse via the
  26. CDN, it's generally better to load a specific version (preferably the
  27. latest one), to avoid breakage when new backwards-incompatible versions are
  28. released.
  29. Initializing Converse
  30. ---------------------
  31. You'll then need to initialize Converse with configuration settings relevant to your requirements.
  32. Refer to the :ref:`configuration-settings` section for info on all the available configuration settings.
  33. To quickly get started, you can put the following JavaScript code at the
  34. bottom of your page (after the closing *</body>* element)::
  35. <script>
  36. converse.initialize({
  37. bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
  38. show_controlbox_by_default: true
  39. });
  40. </script>
  41. The `index.html <https://github.com/jcbrand/converse.js/blob/master/index.html>`_ file inside the
  42. Converse repository may serve as a nice usable example.
  43. Fullscreen version
  44. ------------------
  45. Converse also comes in a fullscreen version.
  46. A hosted version is available online at `conversejs.org/fullscreen <https://conversejs.org/fullscreen.html>`_.
  47. Originally this version was available as a separate build file, but
  48. as of version 4.0.0 and higher, the difference between the "overlay" and the
  49. "fullscreen" versions of converse.js is simply a matter of configuring the
  50. :ref:`view_mode`.
  51. For example::
  52. <script>
  53. converse.initialize({
  54. bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
  55. view_mode: 'fullscreen'
  56. });
  57. </script>
  58. Where to go from here?
  59. ======================
  60. You might want to implement some kind of persistent single-session solution for
  61. your website, where users authenticate once in your website and are then
  62. automatically logged in to the XMPP server as well. For more info on how this
  63. can be achieved, read: :ref:`session-support`.
  64. Perhaps you want to create your own custom build of Converse? Then head over
  65. to the :doc:`builds` section, or more generally the :doc:`development`
  66. documentation.
  67. Do you want to know how to theme Converse? Then read the :doc:`theming`
  68. documentation.