Instance API

Last modified by Admin on 2024/06/15 05:03

cogAPI related to the XWiki instance (e.g. compute a unique id for the instance)
Developed by

XWiki Development Team

0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Standard


Feature added in XWiki 5.2M2

Installable with the Extension Manager


At the moment the only API provided is one to generate and retrieve an id unique per XWiki instance. This can be used to identify uniquely a XWiki instance, even across restarts and across upgrades since the unique id is stored in XWiki's database.

To get the InstanceIdManager:

private Provider<InstanceIdManager> idManagerProvider;

Note the usage of a Provider. This is required only when the component in which you're injecting the Instance Id Manager is loaded before the XWiki Store has been initialized.

The API is:

public interface InstanceIdManager
     * @return the Instance id or null if it isn't set

    InstanceId getInstanceId();

Script service

Since 8.3RC1 Getting the XWiki instance id:


Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.


Dependencies for this extension (org.xwiki.platform:xwiki-platform-instance 16.4.0):

Get Connected