const { TouchBar } = require('electron');
const { TouchBarButton } = TouchBar;

if (TouchBar) {
	const buttons = [new TouchBarButton({
		label: `Click me`.toUpperCase(),
		click: () => {
			console.log('clicked')
		}
	})]

	exports.onWindow = (win) => {
		win.setTouchBar(new TouchBar(buttons));
	}
}

const { TouchBar } = require('electron').remote;
const { TouchBarButton } = TouchBar;

const button = new TouchBarButton({
	label: `🦄 Click me`,
	click: () => {
		console.log('TouchBarButton was clicked');
	}
});

exports.onWindow = (win) => {
	win.setTouchBar(new TouchBar([button]));
}

Change API for Hyper with Electron v1.6.3
Change API for Hyper with Electron v1.6.3
