webflow.subscribe("currentappmode", callback)Subscribe to this event to detect when a user switches modes in the Designer, such as changing to Edit mode or selecting a secondary locale. This event helps you track the user’s current mode, allowing your app to adjust the UI or display relevant error messages based on the available actions.
Tracking mode changes ensures your app provides the right experience at the right time, managing user expectations and preventing actions that aren’t allowed in the current mode.
Designer Extensions enhance user functionality while adhering to the Designer’s current mode. Each method within the Designer API provides specific capabilities, aligning with actions available in each mode. For more context on this API, see the App Modes docs.
event : "currentappmode"
The name of the event to subscribe to.
callback: (event: AppModeChangeEvent) => void
The callback function to execute when the event occurs.
The callback receives an AppModeChangeEvent object with the following properties:
Callbacks that use the previous signature () => void continue to work.
UnsubscribeThis is a special function returned after subscribing. Call this function when you want to stop listening to the event and discontinue receiving notifications.
The callback fires when the user:
The callback does not fire on other user activity, such as mouse movement, keystrokes, or element selection changes.
Previously, the callback received no arguments and the extension had to call the webflow.canForAppMode() method to read the user’s capabilities:
The callback now receives the mode and all capability booleans directly, so the extra call is no longer needed:
Re-render the UI whenever the user switches modes, branches, or locales. The callback’s appModes property removes the need for a separate webflow.canForAppMode() call: