Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.7 KB

File metadata and controls

34 lines (22 loc) · 1.7 KB
code type title description
true
page
init | Framework | Core
Plugin class init() abstract method

init (abstract)

Plugins must expose an init function. If it is missing, Kuzzle fails to load the plugin and aborts its start sequence.

The init method is called once during startup, and it is used to initialize the plugin.

Arguments

init(config: JSONObject, context: PluginContext);

Arguments Type Description
config
JSONObject
Contains the custom plugin configuration
context
PluginContext
The plugin context, exposing various accessors, constructors, and helpers. The other sections of this documentation detail the interfaces made available by this object

Return

The init function can optionally return a promise. If it does, Kuzzle waits for the promise to be resolved before continuing its own initialization.

If a promise is returned, it must be resolved within the configured timeout (see plugins.common.initTimeout in Kuzzle's configuration)

If a promise is returned and rejected, or if the init function throws an error, Kuzzle aborts its start sequence and shuts down.