Hierarchy

Properties

extension: {
    fieldTypes: FieldType[];
    name: string;
    parameters?: {
        installation?: ParameterDefinition[];
        instance?: ParameterDefinition[];
    };
    sidebar?: boolean;
    src?: string;
    srcdoc?: string;
}

Type declaration

  • fieldTypes: FieldType[]

    Field types where an extension can be used

  • name: string

    Extension name

  • Optional parameters?: {
        installation?: ParameterDefinition[];
        instance?: ParameterDefinition[];
    }

    Parameter definitions

  • Optional sidebar?: boolean

    Controls the location of the extension. If true it will be rendered on the sidebar instead of replacing the field's editing control

  • Optional src?: string

    URL where the root HTML document of the extension can be found

  • Optional srcdoc?: string

    String representation of the extension (e.g. inline HTML code)

parameters?: DefinedParameters

Values for installation parameters

sys: ExtensionSysProps

Methods

  • Deletes this object on the server.

    Returns

    Promise for the deletion. It contains no data, but the Promise error case should be handled.

    Example

    const contentful = require('contentful-management')

    const client = contentful.createClient({
    accessToken: '<content_management_api_key>'
    })

    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((extension) => extension.delete())
    .then(() => console.log(`UI Extension deleted.`))
    .catch(console.error)

    Returns Promise<void>

  • Sends an update to the server with any changes made to the object's properties

    Returns

    Object returned from the server with updated changes.

    Example

    const contentful = require('contentful-management')

    const client = contentful.createClient({
    accessToken: '<content_management_api_key>'
    })

    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((extension) => {
    extension.extension.name = 'New UI Extension name'
    return extension.update()
    })
    .then((extension) => console.log(`UI Extension ${extension.sys.id} updated.`))
    .catch(console.error)

    Returns Promise<UIExtension>