Blocks lets you add JavaScript code to your widgets and apps. You can add code to an individual widget or dashboard page, as well as code for the entire app.
This overview covers the various places where you can add code to a Blocks app.
Blocks is currently in a transition from using Velo modules to using the JavaScript SDK. Wherever available, this article suggests the relevant SDK modules.
Learn more about developing with the SDK
Add code to your widget to provide the following:
Blocks custom panels have their own code tab to create their logic.
Design a custom panel, connect it to an action button, and add code to determine what happens in the panel.
Blocks custom panels have designated API references:
@wix/editor
widget module in the SDKwix-editor
Velo module$w
Panel ElementsAdd Dashboard pages to your app to enable site builders to configure your app. Dashboard pages have a designated code tab, as well as designated APIs:
Blocks allows you to create CMS collections and access them in your app and site. Use the @wix/data
SDK module to work with your collections.
Add frontend or backend code files for your entire app. These are also referred to as "code packages".
To add code to your app:
When your app is installed on a site, you can get information about the specific app instance that is currently running. For example, you can use the app instance to retrieve the pricing plan of the current user.
Learn more about working with the app instance in Blocks.