Skip to main content

buildfire.getContext

getContext()

buildfire.getContext(callback)

Used to get the context of the current app/plugin, like (appId, appTheme, pluginId... )

buildfire.getContext((err, context) => {
if(err) return console.log(`ERROR:${err}`);
console.log(`Context: ${JSON.stringify(context)}`);
})

callback(err, data)

NameTypeDescription
errstringerror string, null when operation is successful
dataobjectThe context object
data
NameTypeDescription
apiKeysobjectAPI keys configure for the app
appIdstringUnique app id
appThemeobjectThe customized app theme object from the branding page in the control panel. In control side default control panel theme will be returned.
configTypestringThe app's configuration type (plan); (enterprise, professional, premium, ...)
deviceobjectInformation about the used device (platform ('web', 'iOS' or 'Android'), manufacturer, version, ...)
instanceIdstringThe plugin instance id
liveModenumberReturns (1) if live mode and (0) if draft mode
pluginIdstringThe plugin type id
widgetThemeobjectWidget appTheme for usage in the control side only
titlestringThe given title of the plugin (widget side only)
offlineModeEnabledbooleanTells if the offline mode is enabled for the app or not (mobile devices only)
navbarEnabledbooleanTells if the navbar (footer) is enabled or not in the navbar settings