Properties Quick Links

App Component Properties

App component properties that you have set in the Developer Portal can be retrieved through the SDK.

Builder.getProperties()

Returns an object with all the properties of your app component. This method can be called after the ‘componentLoaded’ event has been fired.

NOTE: The provide realtime updates of property changes in the Sitebuilder editor, you have to use this method instead of Builder.getPropertyValue().

Examples

Builder.getProperties() example

// Function that will be executed when the 'componentLoaded' event has fired
const initialize = () => {
    const properties = Builder.getProperties()
}

// Before we can use this method, we have to be sure everything has loaded, so we listen to the 'componentLoaded' event.
document.addEventListener('componentLoaded', initialize)

Properties object example

{
  property1: "value1",
  property2: "value2"
}

Builder.getPropertyValueByName(name)

Returns the value of a property. Because this value is provided in the query string, you can call this function without having to wait for the ‘componentLoaded’ event.

Parameters

Name Type Description
name String The name of the property.

Example

Builder.getPropertyByName() example

const propertyValue = Builder.getPropertyValueByName("prop1")