SDK and API

HDX SDK

Citrix Workspace app for ChromeOS introduces an API (Experimental API) that allow third-party Chrome apps to lock, unlock, and disconnect from:

  • Citrix Virtual Apps and Desktops
  • Citrix DaaS (formerly Citrix Virtual Apps and Desktops service) session

Using this API, you can launch Citrix Workspace app for ChromeOS in both embedded mode and kiosk mode. Sessions launched in embedded mode function in ways similar to sessions launched kiosk mode.

For the SDK documentation, see HDX SDK for Citrix Workspace app for ChromeOS.

For HDX SDK examples, refer to the Citrix download page.

Enhancements to Chrome HDX SDK APIs

Previously, external apps with the HDX SDK for ChromeOS integration lacked visibility into sessions that were started through methods other than the SDK.

Starting with the 2408 version, the new enhancements to the Chrome HDX SDK provide the ability to identify all active sessions, disconnect specific sessions, disconnect all active sessions, and log out the user from all stores in the Citrix Workspace app (only on-premises stores).

For more information on using APIs, see Enumerate sessions.

Citrix Virtual Channel SDK

The Citrix Virtual Channel Software Development Kit (SDK) supports you to write server-side applications and client-side drivers for additional virtual channels using the ICA protocol.

The server-side virtual channel applications are on Citrix Virtual Apps or Citrix Virtual Apps and Desktops servers. This version of the SDK supports you to write new virtual channels for Citrix Workspace app for ChromeOS. If you want to write virtual drivers for other client platforms, contact Citrix.

The Virtual Channel SDK provides:

  • An easy interface that can be used with the virtual channels in the Citrix Server API SDK (WFAPI SDK) to create new virtual channels.

  • Working source code for several virtual channel sample programs that demonstrate programming techniques.

  • The Virtual Channel SDK requires the WFAPI SDK to write the server side of the virtual channel.

For the VC SDK documentation, see Citrix Virtual Channel SDK for Citrix Workspace app for ChromeOS.

Enhancements to Virtual Channel SDK

Starting with the 2305 release, Citrix Workspace app for ChromeOS supports Window Management APIs in the Virtual Channel SDK. Web APIs enable IT administrators to create interactive applications and customize them for their end users.

Procedure to consume the API in the third-party Chrome app

  1. Install the latest version of Citrix Workspace app for ChromeOS. See the Citrix downloads page for details.
  2. Add the third-party Chrome app to the allow list by adding the policy file for Citrix Workspace app for ChromeOS. Use the Chrome management settings to add the policy.

    For more details, see Manage Chrome Apps by organizational unit on Google support.

    To add the third-party Chrome app to the allow list, here’s the sample policy.txt JSON data:

    {
          "settings": {
                 "Value": {
                 "settings_version": "1.0",
                 "store_settings": {
                 "externalApps": [“<3rdParty_App1_ExtnID>”,“<3rdParty_App2_ExtnID>”]
                                   }
                           }
                    }
    }
    <!--NeedCopy-->
    

    Note:

    <3rdParty_App1_ExtnID> is used as an example for the name of externalApps and can send messages to Citrix Workspace app for ChromeOS. Get your appid from the chrome://extensions site.

  3. Launch the application or a desktop session in Citrix Workspace for ChromeOS as follows:
  • Get the workspaceappID

    var workspaceappID = " haiffjcadagjlijoggckpgfnoeiflnem ";

    Note:

    In this example, workspaceappID indicates the store version of Citrix Workspace app for ChromeOS. If you’re using a repackaged version of Citrix Workspace app for ChromeOS, use the appropriate workspaceappID.

  • Convert ICA data from INI to JSON format.

    Note:

    Typically, the ICA file is retrieved from StoreFront as an INI file. Use the following helper function to convert an ICA INI file into JSON.

     //Helper function to convert ica in INI format to JSON
     function convertICA_INI_TO_JSON(data){
     var keyVals = {};
     if (data) {
     var dataArr;
     if(data.indexOf('\r')==-1){
     dataArr = data.split('\n');
     }else{
     dataArr = data.split('\r\n');
     }
     for (var i = 0; i \< dataArr.length; i++) {
     var nameValue = dataArr[i].split('=', 2);
     if (nameValue.length === 2) {
     keyVals[nameValue[0]] = nameValue[1];
     }
     // This is required as LaunchReference contains '=' as well. The above split('=',2) will not provide
     // the complete LaunchReference. Ideally, something like the following should be used generically as well
     // because there can be other variables that use the '=' character as part of the value.
     if (nameValue[0] === "LaunchReference") {
     var index = dataArr[i].indexOf('=');
     var value = dataArr[i].substr(index + 1);
     keyVals[nameValue[0]] = value;
     }
     }
     console.log(keyVals);//to remove
     return keyVals;
     }
     return null;
     }
    
     <!--NeedCopy-->
    
  • Send an ICA message from the third-party Chrome app to Citrix Workspace app for ChromeOS.

     var icaFileJson = {...}; // ICA file passed as JSON key value pairs.
     var message = {
     "method" : "launchSession",
     "icaData" : icaJSON
     };
     chrome.runtime.sendMessage(workspaceappID, message,
     function(launchStatus) {
     if (launchStatus.success) {
     // handle success.
     console.log("Session launch was attempted successfully");
     } else {
     // handle errors.
     console.log("error during session launch: ", launchStatus.message);
     }
     });
    
     <!--NeedCopy-->
    

For more details on sendMesage API commands, see the following links:

https://developer.chrome.com/extensions/runtime#event-onMessageExternal

https://developer.chrome.com/extensions/runtime#method-sendMessage

Manifest V3 support for SDK scenarios

Starting with the 2305 release, Citrix Workspace app for ChromeOS supports the HDX SDK with Chrome extensions having manifest version 3.

For more information, see Citrix Workspace app for ChromeOS HDX SDK in the developer guides documentation.

SDK and API