Last date modified: 2026-Jul-14
Accessing the Relativity Review API
This page contains legacy content applicable only to Relativity 10.2 (Foxglove) through Relativity 11.1 (Juniper).
Review the following information about how to determine if the Review APIs are available, how to invoke the APIs, and how to listen for events.
This page contains the following information:
See these related pages:
- Relativity Review overview
- Using the Relativity Review API
- Upgrade considerations for viewer integrations
Relativity Review API availability
After the Relativity Review viewer is loaded, the following APIs are available:
window.top.hydroImageApi- This API is available when the Relativity Review image viewer is loaded.window.top.hydroProductionApi- This API is available when the Relativity Review production viewer is loaded.
Note: The Relativity Review API is also available on the window object in the frame hosting the viewer as window.review.
Verify that Relativity Review is enabled
After selecting the image or production viewer, run the following commands to verify that the Relativity Review viewers are enabled:
-
Image viewer
CopydocumentViewer.useHydroViewerRightNow(2); -
Production viewer
CopydocumentViewer.useHydroViewerRightNow(4);
Listen for ready events
After the Review Interface loads, it raises the following events:
- ReviewInterfaceEventType.ApiReady - this event fires when the API is setup.
- ReviewInterfaceEventType.Ready - this event fires when the Review Interface is loaded and the first document is rendered to the user or a navigation request is made before the first document finished loading.
The following code sample illustrates how to listen for these events:
var myEventName = "apiready"; // Or use "ready".
var myEventHandler = function () {
// Do something.
};
review.on(myEventName, myEventHandler);
The review property should be available on the page when you invoke your JavaScript. If it isn't available, the following code sample illustrates how to invoke the API:
function waitForReviewApi(handler) {
if (window.review) {
// If the API is available, invoke the passed in handler.
handler();
} else {
// Otherwise, wait 50 ms for API to become available.
setTimeout(function () {
waitForReviewApi(handler);
}, 50);
}
}
waitForReviewApi(function () {
// Do something that requires window.review here.
});