About the Wix JavaScript SDK

Share your feedback
Your feedback helps us improve the development experience! Join the Devs on Wix Discord community to discuss features, give feedback, and connect with our growing community of developers.

The Wix JavaScript SDK allows you access to Wix business solutions and site data from JavaScript code. For example, you can use the @wix/stores package to interact with the Wix Stores product catalog and handle site orders.

Uses

The Wix JavaScript SDK can be used with:

  • Wix Headless: Take advantage of Wix functionality from any app or site you create, on any platform.

  • Wix apps: Develop an app that can be installed on Wix sites.

Wix Headless

You can use the SDK to code external sites or apps that access an existing Wix site's business data, or you can create a new project on Wix that takes advantage of Wix's advanced business solutions for managing bookings, eCommerce, events, and more.

With Wix Headless, several apps and sites can be connected to the same Wix project, with or without a Wix site created in the Wix Editor.

Learn more about Wix Headless and building a headless project with the SDK.

Wix apps

You can use the SDK to code a Wix app that communicates with sites it's installed on and can access and manage the business solutions installed on the site.

To use Wix APIs in Apps, site owners must grant you explicit permission for the operations you perform, either when installing the app on their site, or by providing an API key.

Important:

Use of Wix APIs when building Wix apps are subject to the Wix App Market Guidelines.

Learn more about building an app.

App development frameworks

When you build an app, you need to choose one of Wix's development frameworks in which to build it:

Depending on the framework you are developing in, you may or may not need to handle server management (server setup, maintenance, and security) or use a Wix Client to call the Wix SDK:

  • Wix-hosted: Wix Blocks and the Wix CLI. These frameworks handle server management and you don't need to use a Wix Client to call the Wix SDK.
  • Self-hosted: In self-hosted apps, you need to handle server management yourself and use a Wix Client to call the Wix SDK. Learn more about calling the Wix SDK from self-hosted apps.

Note: Throughout the Wix SDK reference, there are examples for calling each function in Wix-hosted and self-hosted frameworks.

Webhooks

Wix apps can subscribe to webhooks to respond to specific app and site events. The SDK streamlines webhook integration by providing methods to register a callback function as an event handler. For more information, see Handle Events With Webhooks.

Service plugins

Service plugins allow your Wix app to extend the functionality of a Wix site by injecting custom logic into existing app flows or introducing entirely new flows. Learn how to add a Wix-hosted service plugin with the CLI or implement a self-hosted service plugin.

SDK packages

The SDK includes a universal npm package @wix/sdk which manages authentication and communication with the Wix platform.

Each domain, such as Contacts or Stores, also has its own npm package.

Self-hosted apps and headless sites must initialize and use a Wix Client to call SDK methods.

To work with any domain, you need both the universal SDK package and the package for the domain you wish to work with. For example, to work with Contacts, you need both @wix/sdk and @wix/contacts.

These packages are fully typed, making the structure of parameters and fields predictable and easy to work with. Package versioning follows SemVer convention, for convenient dependency management.

Did this help?