vSphere Client JavaScript API: htmlClientSdk Interface
Last Updated December 16, 2024

The htmlClientSdk object provides access to all the JavaScript API interfaces. You load and initialize the htmlClientSdk first in your plug-in views.

htmlClientSdk.getProxiedPluginServerOrigin()

Signature
htmlClientSdk.getProxiedPluginServerOrigin():string
Description
Returns a proxy URL for the plug-in manifest server root. The URL contains the protocol, domain, and port of the vCenter Server, with a proxy path that routes to the plug-in manifest server root. This URL is useful to set a root-relative
base
tag for relative URLs in a front-end framework such as Angular. This method can be safely called before the SDK has been initialized.

htmlClientSdk.initialize()

Signature
htmlClientSdk.initialize(callback:function):void
Description
Initializes the htmlClientSdk object and invokes the callback function when initialization is complete and the other JavaScript interfaces are available. After the first call, subsequent calls act to register additional callbacks.
Parameter:
callback
The optional callback function must have the following signature:
function callback():void
The callback function has access to all the functions in the JavaScript API. You use the callback to code logic for initializing plug-in state.

htmlClientSdk.isInitialized()

Signature
htmlClientSdk.isInitialized():boolean
Description
Tests whether the htmlClientSdk object has been initialized.