A function library bundles reusable, stateless functions that a Wix user connects to a slot in the editor, like an ERC prop or event handler. It has no state and no UI of its own.
Follow the instructions below to:
Note: You can also ask Aria, Wix's AI assistant, to create and customize the extension.
To add a function library:
In the Studio Two editor, open the Code tab.
In the VS Code sidebar, open the Wix Extension Builder.

Under Create an Extension, choose Site, then Function Library.
Fill in the form:
Click Generate.
You can find the new files under src/extensions/site/function-libraries/<extension-folder>/. The library is added to your project's extensions.ts automatically, so it's registered as soon as it's created:
<extension-folder>.extension.ts: The function library manifest. Declares each function's name, parameters, and return type.<extension-folder>.ts: The implementation file. Exports one function per entry in the manifest, matching it by name.The boilerplate is a working formatPrice function that you replace with your own functions.
You can edit the generated files to match the logic you need. When you're happy with the library, move on to the next step.
For the full workflow, from declaring functions in the manifest to implementing them, see Build a Function Library in Studio Two.
To check the function library:
type, for example companionApp.docsDemoFuncLib, not its display name.The bound element then shows the function's return value, computed from the parameters you set.
When you're ready, click Publish in the Studio Two editor. Your function library ships with the published site.
Last updated: 2 November 2026