Function used to retrieve an FDC3 Desktop Agent API instance, which supports the discovery of a Desktop Agent Preload (a container-injected API implementation) or a Desktop Agent Proxy (a Browser-based Desktop Agent running in another window or frame). Finally, if no Desktop Agent is found, a failover function may be supplied by app allowing it to start or otherwise connect to a Desktop Agent (e.g. by loading a proprietary adaptor that returns a DesktopAgent implementation or by creating a window or iframe of its own that will provide a Desktop Agent Proxy.

const fdc3 = await getAgent();

// OR

getAgent({
identityUrl: "https://example.com/path?param=appName#example",
channelSelector: false,
intentResolver: false
}).then((fdc3) => {
//do FDC3 stuff here
};
  • Parameters

    • Optionalparams: GetAgentParams

      Optional parameters object, which may include a URL to use for the app's identity, other settings that affect the behavior of the getAgent() function and a failover function that should be run if a Desktop Agent is not detected.

    Returns Promise<DesktopAgent>

    A promise that resolves to a DesktopAgent implementation or rejects with an error message from the AgentError enumeration if unable to return a Desktop Agent implementation.