Create Your First Application

Getting up and running on OpenFin is just as easy as getting up and running on the web. We’ll get started with a simple application template available here.


By downloading OpenFin, you agree to the terms of our Developer License.

Quick Start

git clone https://github.com/HadoukenIO/app-template.git
cd app-template
npm install
npm start

This template hosts a single page app locally and then launches it on the runtime using the openfin-launcher.

App.json file

Each application will need an application configuration file. This file can live in the filesystem or hosted on a web server, we recommend you to host this file as part of your application. Both the openfin-cli and OpenFinRVM.exe will use them to launch applications

Lets take a look at the app.json file located in the generated template folder. This is a straightforward configuration file and you can read more in our config file API docs.

 

{
    "startup_app": {
        "name": "OpenfinPOC",
        "url": "http://localhost:5555/index.html",
        "uuid": "OpenfinPOC",
        "applicationIcon": "http://localhost:5555/favicon.ico",
        "autoShow": true,
        "saveWindowState": true
    },
    "runtime": {
        "arguments": "--remote-debugging-port=9090",
        "version": "community"
    },
    "shortcut": {
        "company": "OpenFin",
        "description": "Openfin POC",
        "icon": "http://localhost:5555/favicon.ico",
        "name": "Openfin POC"
    }
}

Main.js

All of the browser APIs available to developers are also available when buidling on OpenFin. These are supplemented by the Javascript API, which is injected into every OpenFin Window. In our Main.js, we use a combination of the OpenFin API and browser APIs to retrieve the version of OpenFin you’ve launched on and update the DOM.

 

function onMain() {
    const app = fin.desktop.Application.getCurrent();
    fin.desktop.System.showDeveloperTools(app.uuid, app.uuid);
    fin.desktop.System.getVersion(version => {
        const ofVersion = document.querySelector('#of-version');
        ofVersion.innerText = version;
    });
}


Have questions? Get in touch with us at support@openfin.co