quickstart.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. You can try out the latest version of Converse on `conversejs.org <https://conversejs.org>`_
  9. for the overlayed version and `conversejs.org/fullscreen.html <https://conversejs.org/fullscreen.html>`_
  10. for the full page version.
  11. If you want to host Converse yourself, there are a few options available to
  12. you.
  13. Let your XMPP server serve Converse for you
  14. -------------------------------------------
  15. If you run your own XMPP server, you might first want to check whether it has
  16. a plugin or module for hosting Converse for you.
  17. * OpenFire has the `inverse <https://www.igniterealtime.org/projects/openfire/plugin-archive.jsp?plugin=inverse>`_ plugin.
  18. * Prosody has `mod_conversejs <https://modules.prosody.im/mod_conversejs.html>`_.
  19. Serving Converse yourself
  20. -------------------------
  21. Alternative you can serve only Converse without requiring any particular
  22. XMPP server.
  23. To do so, you'll need to get the right files to host, for which you have four
  24. options.
  25. .. note::
  26. Pro-tip, if you just want to quickly test things locally, you can quickly start
  27. up an HTTP server with Python by running ``python -m SimpleHTTPServer``
  28. Option 1: Use the content delivery network
  29. ******************************************
  30. Converse has a `CDN <https://en.wikipedia.org/wiki/Content_delivery_network>`_, provided by `KeyCDN <http://keycdn.com/>`_,
  31. which hosts its JavaScript and CSS files.
  32. The latest versions of these files are available at these URLs:
  33. * https://cdn.conversejs.org/dist/converse.min.js
  34. * https://cdn.conversejs.org/dist/converse.min.css
  35. If you are integrating Converse into an existing website or app, then we recommend
  36. that you load a specific version of Converse. Otherwise your website or app
  37. might break when a new backwards-incompatible version of Converse is released.
  38. To load a specific version of Converse you can put the version in the URL:
  39. * https://cdn.conversejs.org/5.0.0/dist/converse.min.js
  40. * https://cdn.conversejs.org/5.0.0/dist/converse.min.css
  41. You can include these two URLs inside the *<head>* element of your website
  42. via the *script* and *link* tags:
  43. .. code-block:: html
  44. <link rel="stylesheet" type="text/css" media="screen" href="https://cdn.conversejs.org/4.2.0/dist/converse.min.css">
  45. <script src="https://cdn.conversejs.org/4.2.0/dist/converse.min.js" charset="utf-8"></script>
  46. Option 2: Download the builds from Github
  47. *****************************************
  48. The `Converse releases page on Github <https://github.com/conversejs/converse.js/releases>`_
  49. has the release notes for every release as well as links to downloadable zip files
  50. containing all the files you need to host Converse yourself.
  51. Extract the zip file and include converse.min.js and converse.min.css files in
  52. the *<head>* element of your page, similar as shown in option 1 above.
  53. Option 3: Building the files yourself
  54. *************************************
  55. Instead of using the CDN, you can also create your own builds and host them yourself.
  56. Have a look at the :ref:`creating_builds` section on how to create your own builds.
  57. In short, you should be able to do it by running ``make dist`` inside a
  58. checkout of the `Converse repo <http://github.com/conversejs/converse.js/>`_.
  59. .. note::
  60. When hosting Converse yourself without using the CDN (options 2 and 4),
  61. you'll need to need to make sure that the ``webfonts`` directory is available in
  62. the same location as ``converse.min.css``.
  63. Initializing Converse
  64. =====================
  65. You'll need to initialize Converse with configuration settings relevant to your requirements.
  66. Take a look at the :ref:`configuration-settings` section for info on all the available settings.
  67. To quickly get started, you can put the following JavaScript code at the
  68. bottom of your page (after the closing *</body>* element)::
  69. <script>
  70. converse.initialize({
  71. bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
  72. show_controlbox_by_default: true
  73. });
  74. </script>
  75. The `index.html <https://github.com/jcbrand/converse.js/blob/master/index.html>`_ file inside the
  76. Converse repository serves as a nice, usable example.
  77. Fullscreen version
  78. ------------------
  79. Converse also comes in a fullscreen version.
  80. A hosted version is available online at `conversejs.org/fullscreen <https://conversejs.org/fullscreen.html>`_.
  81. Originally this version was available as a separate build file, but
  82. as of version 4.0.0 and higher, the difference between the "overlay" and the
  83. "fullscreen" versions of converse.js is simply a matter of configuring the
  84. :ref:`view_mode`.
  85. For example::
  86. <script>
  87. converse.initialize({
  88. bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
  89. view_mode: 'fullscreen'
  90. });
  91. </script>
  92. Where to go from here?
  93. ======================
  94. Have a look at the various :ref:`features <features>` that Converse provides, for some of
  95. them you might have to do more setup work, like configuring an XMPP server or
  96. webserver.
  97. You might want to implement some kind of persistent single-session solution for
  98. your website, where users authenticate once in your website and are then
  99. automatically logged in to the XMPP server as well. For more info on how this
  100. can be achieved, read: :ref:`session-support`.
  101. For end-to-end encryption via OMEMO, you'll need to load `libsignal-protocol.js
  102. <https://github.com/signalapp/libsignal-protocol-javascript>`_ separately in
  103. your page. Take a look at the section on :ref:`libsignal <dependency-libsignal>` and the
  104. :ref:`security considerations around OMEMO <feature-omemo>`.
  105. Perhaps you want to create your own custom build of Converse? Then head over
  106. to the :doc:`builds` section, or more generally the :doc:`development <development>`
  107. documentation.
  108. Do you want to know how to theme Converse? Then read the :doc:`theming <theming>`
  109. documentation.