Use Here™ Core in a web browser
The original and most feature-rich way to use Here™ Core is to develop desktop applications. However, because Here™ Core apps are typically created using web standard technologies (HTML, CSS, and JavaScript), developers might want to develop web apps that can run either in a desktop Here™ Core environment or in a generic web browser.
When developing apps that run in a web browser, you can use the Here™ Core Web package. It uses the same TypeScript definitions as the desktop Here™ Core package.
The Here Core Web package provides the following functionality:
Download and install
To use the Here Core Web package in your application, do the following:
-
Install the npm package:
> npm install openfin/core-web
-
Import the bindings you need from
openfin/core-web
The specific bindings you need to import depend on what you are using the package to do. Refer to web interop and web layouts, as appropriate.
Configure logging
As with the Here™ Core desktop library, you can configure the level of logging messages that Here Core Web generates. The strings indicating the levels are the same as the log levels in the desktop Container API.
You pass the log level when starting each component:
init({
sharedWorkerUrl: `${location.origin}/openfin-shared-worker.js`,
logLevel: 'debug'
});
const fin = await connect({
connectionInheritance: 'enabled',
options: { brokerUrl },
platform: { layoutSnapshot },
logLevel: 'debug'
});
Examples
To review fully-worked examples of using Here™ Core Web, see the Web Starter repository on GitHub.