Turbine free variable

The turbine object is a “free variable” within the scope of your extension’s library modules. It provides information and utilities specific to the Adobe Experience Platform Launch runtime and is always available to library modules without using require().

buildInfo

console.log(turbine.buildInfo.turbineBuildDate);

turbine.buildInfo is an object containing build information about the current Platform Launch runtime library.

{
    turbineVersion: "14.0.0",
    turbineBuildDate: "2016-07-01T18:10:34Z",
    buildDate: "2016-03-30T16:27:10Z",
    environment: "development"
}
Property Description
turbineVersion The Turbine version used inside the current library.
turbineBuildDate The ISO 8601 date when the version of Turbine used inside the container was built.
buildDate The ISO 8601 date when the current library was built.
environment The environment for which this library was built. Accepted values are development, staging, and production.

debugEnabled

Whether Platform Launch debugging is currently enabled.

If you are simply attempting to log messages, it’s unlikely you will need to use this. Instead, always log messages using turbine.logger and Platform Launch will ensure your messages are only printed to the console when Platform Launch debugging is enabled.

getDataElementValue

console.log(turbine.getDataElementValue(dataElementName));

Returns the value of a data element.

getExtensionSettings

var extensionSettings = turbine.getExtensionSettings();

Returns the settings object that was last saved from the extension configuration view.

Please note that values within the returned settings objects may be coming from data elements. Because of this, calling getExtensionSettings() at different times may yield different results if the values of the data elements have changed. To get the most up-to-date values, please wait until as late as possible before calling getExtensionSettings().

getHostedLibFileUrl

var loadScript = require('@adobe/reactor-load-script');
loadScript(turbine.getHostedLibFileUrl('AppMeasurement.js')).then(function() {
  // Do something ...
})

The hostedLibFiles property can be defined inside the extension manifest in order to host various files along with the Platform Launch runtime library. This module returns the URL where the given library file is hosted.

getSharedModule

var mcidInstance = turbine.getSharedModule('adobe-mcid', 'mcid-instance');

Retrieves a module which has been shared from another extension. If no matching module is found, undefined will be returned. See Implementing Shared Modules for more information regarding shared modules.

logger

turbine.logger.error('Error!');

Logging utility used to log messages to the console. Messages will only show in the console if debugging is turned on by the user. The recommended way to turn on debugging is to use the Adobe Experience Cloud Debugger or the Platform Launch and DTM Switch Chrome extension. As an alternative, the user can run the following command _satellite.setDebug(true) inside the browser development console. The logger has the following methods:

  • logger.log(message: string): Logs a message to the console.
  • logger.info(message: string): Logs an informational message to the console.
  • logger.warn(message: string): Logs a warning message to the console.
  • logger.error(message: string): Logs an error message to the console.
  • logger.debug(message: string): Logs a debug message to the console. (Visible only when verbose logging is enabled within your browser console.)

onDebugChanged

By passing a callback function into turbine.onDebugChanged, Platform Launch will call your callback whenever debugging is toggled. Platform Launch will pass a boolean to the callback function which will be true if debugging was enabled or false if debugging was disabled.

If you are simply attempting to log messages, it’s unlikely you will need to use this. Instead, always log messages using turbine.logger and Platform Launch will ensure your messages are only printed to the console when Platform Launch debugging is enabled.

propertySettings

console.log(turbine.propertySettings.domains);

An object containing the following settings which are defined by the user for the property of the current Platform Launch runtime library:

  • propertySettings.domains: Array<String>

    An array of domains that the property covers.

  • propertySettings.undefinedVarsReturnEmpty: boolean

    Extension developers should not be concerned with this setting.

On this page

Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now