Close the extension

webflow.closeExtension()

Close the Designer Extension using the Webflow object.

Syntax

webflow.closeExtension(): Promise<null>

Returns

Promise<null>

A Promise that resolves to null.

Example

This ReactJSexample shows how to close the extension using a button.

function CloseExtensionButton() {
const handleCloseExtension = async () => {
try {
await webflow.closeExtension();
console.log("Extension closed successfully.");
} catch (error) {
console.error("Failed to close the extension:", error);
}
};
return (
<button onClick={handleCloseExtension}>
Close Extension
</button>
);
}