How to integrate any JavaScript library or component in XWiki?

Version 1.2 by Oana Florea on 2019/09/10

You can integrate any JavaScript library / component in XWiki. There are multiple ways to do this, see . The recommended way is to:

  • install the third party JavaScript as a WebJar using XWiki's Extension Manager
  • load the JavaScript using RequireJS

If there's no WebJar package available for the JavaScript library you want to integrate then you can load it from a CDN (such as or or from the file system (by putting the JavaScript code inside XWiki's unpacked WAR).

RequireJS implements the AMD (Asynchronous Module Definition) API so the easiest for XWiki is to integrate JavaScript libraries that support AMD. This is the case for instance with React (

 Thanks to mflorea for contributing this faq. 

Tags: javascript
Created by Oana Florea on 2019/01/22

Get Connected