Plugin Development

Plugins are a way to tie javascript into the base system, in order to augment the functionality of a web-tech app and give it access to more resources.

If you have code that can be implemented in pure javascript and can be run within the context of a browser or webkit, then you don’t need a plugin.

But when you want to use native capabilities that go beyond the web app, plugins are where it’s at.


Coraline plugins need two important components:

  1. A javascript API — if a version of this plugin exists for other platforms (e.g. Android or iOS), then the plugin must respect that JS API, i.e. be usable in the same way across all platforms.
  2. A Coraline Plugin interface — this is how coraline bridges the client-side requests with your C++ code on the native side.

Quick Start: Plugin Skeleton Generator

The absolute easiest way to get started is to use the Coraline Plugin Development Skeleton Generator.

To use it, start by installing the coraline plugin development headers:

Once that’s done, choose a name for your plugin and get the skeleton generator:

$ git clone \
$ cd coraline-dev-plugin
$ mkdir gen; cd gen
$ cmake -DPLUGIN_CLASS=AwesomePossum ..

This will prompt the generator to create an “awesomepossum” directory under coraline-dev-plugin.  You can leave it there, or move it somewhere else.

From within the awesomepossum directory, creating the plugin is basically


$ mkdir build; cd build
$ cmake ..
$ make package


That’s it, your plugin is ready to install.  You’ll want to customize it, of course, but all the boilerplate is taken care of, and there’s some sample code as well.