quickstart.rst 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. You can use the latest version of Converse at `conversejs.org <https://conversejs.org/fullscreen.html>`_.
  7. There are several ways to run Converse yourself or to add it to your website or web app:
  8. Option 1: Host it via your XMPP Server
  9. ======================================
  10. If you run your own XMPP server, check if it has a plugin for hosting Converse.
  11. For example, the following XMPP servers have plugins available:
  12. * **Openfire**: `inverse plugin <https://www.igniterealtime.org/projects/openfire/plugin-archive.jsp?plugin=inverse>`_
  13. * **Prosody**: `mod_conversejs <https://modules.prosody.im/mod_conversejs.html>`_
  14. * **ejabberd**: `mod_conversejs <https://docs.ejabberd.im/admin/configuration/modules/#mod-conversejs>`_
  15. Option 2: Self-hosting
  16. ======================
  17. Getting the necessary files
  18. ---------------------------
  19. You can host Converse on your own server without requiring any XMPP server.
  20. There are three ways to get the necessary files:
  21. A. Using the CDN (Recommended)
  22. ******************************
  23. Converse provides a CDN (via `KeyCDN <https://www.keycdn.com/>`_) for easy integration.
  24. To use it, add these lines to your HTML page's ``<head>`` section:
  25. .. code-block:: html
  26. <!-- Replace 10.1.5 with your desired version -->
  27. <link rel="stylesheet" href="https://cdn.conversejs.org/10.1.5/dist/converse.min.css">
  28. <script src="https://cdn.conversejs.org/10.1.5/dist/converse.min.js" charset="utf-8"></script>
  29. .. warning::
  30. Always specify a version number in production to avoid breaking changes.
  31. B. Download Pre-built Files
  32. ***************************
  33. 1. Download the latest release from the `Converse GitHub releases page <https://github.com/conversejs/converse.js/releases>`_
  34. 2. Extract the archive file
  35. 3. Include the minified files in your HTML:
  36. .. code-block:: html
  37. <link rel="stylesheet" href="path/to/converse.min.css">
  38. <script src="path/to/converse.min.js" charset="utf-8"></script>
  39. .. important::
  40. * All the files from the ``dist`` directory need to be available and hosted on your server
  41. * Converse will dynamically load additional files from this directory
  42. * To use a different path, change the :ref:`assets_path` setting
  43. C. Build from Source
  44. ********************
  45. For custom builds and development, run the following commands:
  46. 1. ``git clone git@github.com:conversejs/converse.js.git`` to clone the repo.
  47. 2. ``cd converse.js && npm install`` to install dependencies
  48. 3. ``npm run build`` to build distribution files to the ``./dist`` folder
  49. 4. ``npm run serve`` to start a local server at port ``8080``.
  50. 5. You can now access Converse at http://localhost:8080/dev.html in your browser.
  51. See the :ref:`creating_builds` section for detailed build instructions and customization options.
  52. .. tip::
  53. You can run ``npm run watch`` to automatically rebuild the dist files whenever a source file changes.
  54. Initializing Converse
  55. ---------------------
  56. After building and including the necessary files, you need to initialize Converse:
  57. .. code-block:: html
  58. <script>
  59. converse.initialize();
  60. </script>
  61. See the :ref:`configuration-settings` section for all available initialization options and the
  62. `index.html <https://github.com/jcbrand/converse.js/blob/master/index.html>`_ file in the repository for a complete example.
  63. Display Modes
  64. *************
  65. Converse supports different display modes:
  66. * **Full page mode** (default): Chat takes up the entire page
  67. * **Overlay mode**: Chat appears in a corner of your page
  68. * **Embedded mode**: Chat appears embedded inside a container element in your page
  69. To use fullscreen mode, simply set the ``view_mode`` parameter:
  70. .. code-block:: javascript
  71. converse.initialize({
  72. view_mode: 'fullscreen' // other options are `overlay` and `embedded`
  73. });
  74. Further reading
  75. ===============
  76. Now that you have Converse running, you might want to:
  77. * Explore available :ref:`features <features>` (some require additional setup)
  78. * Implement :ref:`session-support` for single sign-on between your site and XMPP
  79. * Enable :ref:`OMEMO encryption <feature-omemo>` (requires loading `libsignal-protocol.js <https://github.com/signalapp/libsignal-protocol-javascript>`_)
  80. * Create :doc:`custom builds <builds>` with specific features
  81. * Customize the appearance with :doc:`theming <theming>`
  82. * Dive into :doc:`development <development>` to contribute or extend Converse