Developing websites on Wix offers a unique blend of flexibility, ease-of-use, and powerful features. Wix provides the tools and technologies needed to craft visually appealing and fully-functional dynamic web applications tailored to your specific needs.
Until now, custom code on Wix sites was written using Velo APIs. You can now also use the Wix JavaScript SDK for both site development and app building with Blocks. If you have sites with existing Velo code, you might want to migrate them to use the SDK instead.
Wix's transition to the SDK is a gradual process. At this stage, the SDK doesn't currently support the functionality of all Velo APIs for site development or for app creation with Blocks. For functionality that is not yet supported in the SDK, use Velo APIs alongside the SDK.
The Velo APIs that should still be used at this stage fall into 2 categories:
The APIs in the Velo-Only APIs section of the Velo reference don't have functionality supported by the SDK. There are also APIs in the APIs section of the Velo reference that don't currently have functionality that's fully supported by the SDK, but there's no rule that defines which these are. To learn which Velo APIs have fully, partially, or not supported by the SDK, see Velo to SDK API Mapping.
If you need the functionality of these APIs, you need to use their Velo versions. When necessary, import and use these APIs as described in the Velo reference.
The following APIs may have SDK counterparts, but the SDK versions don't work for site development and for app creation with Blocks. Therefore, if you need the functionality of these APIs, you need to use them with their Velo file and method name conventions as described below.
getConfig()
method in the plugin's -config.js file, and implement the main service plugin method in the .js file that is added to your site.Wix site code runs on Wix’s cloud infrastructure, where authentication is handled automatically. When using the SDK for site development, you don’t need to create a Wix client because the SDK already knows the caller's identity. Just call the SDK’s APIs directly, and authentication is taken care of for you.
This example demonstrates using SDK functionality alongside Velo APIs. Here we create a router using the Velo API by using method naming conventions and some methods imported from the wix-router
module. The router retrieves data using the @wix/data
SDK package.