quickstart.rst 6.0 KB

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