Using Plugins

Plugins let you add functionality to your app which is not available as a web app. There are thousands of Cordova plugins, plus you can add your own.

Plugins are written using native code, so you can access system APIs and features which browsers are locked out of.

The biggest repository of plugins is on npm.

Load from npm

This is the most common way to load plugins into your project. Each time you build, VoltBuilder fetches the latest version of the plugin you specify. The files are not included in your upload, so your zip file stays relatively small.

For each plugin you want to use, add a line like this to your config.xml:

<plugin name="cordova-plugin-device" spec="^2.1.0" />

Load from a git repository or website

If you’re on an Enterprise Plan, you can bypass npm and load plugins directly from their GitHub repositories.

The repo needs to be public, otherwise VoltBuilder will not be allowed to load.

<plugin name="cordova-plugin-device" spec="https://github.com/apache/cordova-plugin-device.git#2.1.0" />

Note that other HTTP URLs should work too - not just GitHub.

From a local folder

If you’re on an Enterprise Plan, you can put the files for the plugin directly into your project. There are two ways to do this.

In this case, we’re putting the plugin folder at the top level of the project, and telling config.xml where to look for it.

<plugin name="cordova-plugin-device" spec="cordova-plugin-device" />
Project Root
├-- config.xml
├-- certificates
├-- cordova-plugin-device (folder)
├-- voltbuilder.json
└-- www

(tar is also supported - substitute cordova-plugin-device.tar)

From a plugins folder

If you’re on an Enterprise Plan, there is a second way to put the files for the plugin directly into your project.

If you have a plugins folder at the top level, the contents of that will automatically be loaded. There is no need for an entry in config.xml.

Project Root
├-- config.xml
├-- certificates
├-- plugins
│   └-- cordova-plugin-device (folder)
├-- voltbuilder.json
└-- www (required)