Configuring your Designer Extension
This guide provides an overview of how to configure your Webflow Designer Extension. You’ll understand the project structure, and how to customize its behavior with webflow.json
.
Initializing your project
We strongly recommend starting your project with the webflow extension init
command. This will create a project foundation tailored for Designer Extensions and ensure all necessary dependencies and configurations are installed correctly.
The CLI also supports templates for specific libraries and languages like React and TypeScript. You can view available templates by running webflow extension list
.
Understanding the project structure
After running the init
command, your project will have a specific file structure. The public
folder contains all the files needed to serve your Designer Extension.
Key files
Referencing assets
When linking to CSS and JavaScript files in index.html
, always use relative paths (e.g., ./styles.css
) instead of absolute paths (e.g., /styles.css
). This ensures your assets are loaded correctly.
App settings (webflow.json
)
The webflow.json
file is the manifest that controls your app’s behavior. Here are the available properties:
Specifies the name of the Webflow App. It should be a descriptive and unique name that helps identify the app.
The version of the Designer APIs your app is using. It’s highly recommended to set this value to "2"
Defines the size of the Designer Extension window. Available sizes include:
default
: 240px by 360pxcomfortable
: 320px by 460pxlarge
: 800px by 600px
If a size is not declared, the window defaults to default
. You can also dynamically change the size using the webflow.setExtensionSize()
API.
Determines the directory to build and serve the app from. If not declared, it defaults to /public
.
Defines the element types that can create connections to your App. See the documentation on App Intents for more details.
An array of unique identifiers for establishing connections between your app and elements on the canvas. See the documentation on App Connections for more details.
Building and running locally
The scaffold for your extension includes a TypeScript file at src/index.ts
. Use this file to interact with the Designer APIs.
When you’re ready to test, run the npm run build
command. This transpiles your TypeScript into JavaScript, outputting the result to /public/index.js
. Do not modify /public/index.js
directly, as it will be overwritten.
To run your extension locally, use the webflow extension serve
command. This will allow you to interact with your extension within the Webflow Designer.
Bundling for production
When you’re ready to publish, you need to bundle your extension. This process compiles your code and creates a bundle.zip
file. You can read more about how to bundle your extension in our guide on publishing your extension.
If you used webflow extension init
, you can run:
Otherwise, use the CLI command:
Working with Frameworks
For frameworks like Next.js that generate browser-ready files, build with the framework first, then run webflow extension bundle
on the output directory.