Designer API: Version 2
We’re excited to introduce the new version of Webflow’s Designer APIs, featuring enhanced functionality and more efficient methods for interacting with the Designer. Refer to the migration guide to learn more about configuring your App to work with version 2 of Webflow’s Designer APIs.
Notable changes
Simplified edit semantics
The .save()
method has been removed from many of the API’s objects. Rather than staging “local changes” and explicitly synchronizing via element.save()
, the API now makes changes as they’re invoked.
Accessing native elements
Through the introduction of the Element Presets Object, the API now allows Apps to insert native elements onto the canvas.
Inserting elements
The new version of the Designer API introduces new helper methods that make it easier to insert elements into a hierarchy:
The Designer API v2 removes legacy element creation methods in favor of more flexible insertion methods.
createDOM()
createString()
createHeading()
Direct editing of components
This API enables a more streamlined approach to editing component objects. You can now access the root element of a component object by using the get-root-element
method.
Clear and consistent naming
Minor naming changes to clarify Designer API functionality:
- “Folders” → “PageFolders” to disambiguate versus other Page resources (for example, Asset pages)
- “og-” → “openGraph-” prefix for Open Graph Page Fields
Clear and consistent return objects
- Most methods that aren’t meant to return a value, like
remove
, now return a Promise that resolves tonull
instead ofundefined
- Element IDs are now identified by their component and element ids, for example:
New methods and objects
Elements
- Element Presets
- Remove element
- Insert Element before target element
- Insert element after target element
- Nest element as first child
- Nest element as last child
Styles
Removed methods
.save()
webflow.createDOM()
webflow.createHeading()
webflow.createString()