Tutorial: Getting started

Getting started

The Embed SDK provides a mechanism to embed the webclient in a browser page and programatically interact with host sessions.

The library is packaged with the session server and available at <hacloud-server>/connector/zfe-embed-sdk.js.

A basic example

A functional page can be created quickly with minimal code.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>Embed SDK Basics</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="http://zfe.company.com:7070/connector/zfe-embed-sdk.js"></script>
  </head>
  <body>
    <div id="my-host-app" style="width: 800px; height: 600px"></div>
    <script>
      // Create the connector
      var zfe = new ZFE.ZFE({
        url: 'http://zfe.company.com:7070/',
        username: 'johnsm',
        password: '12345',
        domain: 'CORPDOM',
        target: document.getElementById('my-host-app')
      });
      // Connect to the session server
      zfe.connect()
        .then(function() {
          console.log('The SDK is connected and ready to use');
        })
        .catch(function(error) {
          console.error('There was an error connecting to the session server', error);
        });
    </script>
  </body>
</html>