Api

Api

Top level api object from which all other api modules are available.

getVersion()⇒ string

Get current version of the Writer

Returns: string - Version tag

getClientVersion()

Gets internal writer-client version currently running

getConfigValue(id, path, defaultValue)⇒ *

Get configuration value in a plugins local configuration data section. If no path is given the full configuration object for the plugin instance is returned.

Returns: * - The value of the wanted configuration path or default value

Parameters

Example

{
   "vendor": "vendor.tld",
   "name": "myplugin",
   "enabled": true,
   "data": {
     "mykey": "Configuration value"
   }
 },

Example

import {api} from 'writer'
var apiEndpoint = api.getConfigValue('myplugin', 'mykey');`

hasLocalConfiguration()⇒ Boolean

Check if the configuration has been overridden with local configuration

getPluginModule(moduleId)⇒ Object

Return a fresh instance of a specific plugin provided module

Parameters

getPluginModulesForTarget(targetId)

Get modules targeted at a specific consumer

Parameters

Types

ApiOptions: Object

Parameters