This article explains how to call methods from backend SDK modules across different Wix development frameworks and environments. Backend modules are SDK packages with REST API equivalents, and you can find them in this reference. They're universal and work in both Wix-hosted and self-hosted environments.
The context where your code runs. For example, in a site you can call SDK methods from a site page, a dashboard page, or backend code.
Whether you need elevated permissions to call restricted methods. Elevation lets you call methods that require higher-level permissions than the calling identity has, such as performing administrative operations from frontend code or handling sensitive data on behalf of site visitors or members.
SDK methods are asynchronous. Always call them inside an async function using await.
Note: The examples in this article use methods from the @wix/ecom module:
currentCart.addToCurrentCart(): Adds items to the current visitor's cart. Can be called with a visitor or member identity.
orders.createOrder(): Creates an order. Requires higher-level permissions (app or Wix user identity).
This article covers the majority of typical use cases. If your specific scenario isn't included, consult the relevant documentation for further guidance.
Backend extension: Call SDK methods from a backend extension with an app identity.
Backend extension with elevation: Call SDK methods from a backend extension using elevation when they require higher-level permissions than the calling identity has.
Site extension: Call SDK methods from a site extension with a visitor or member identity.
Site extension with elevation: Call SDK methods from a site extension using elevation when they require higher-level permissions than the calling identity has.
Backend extension: Call SDK methods from a backend extension with an app identity.
Backend extension with elevation: Call SDK methods from a backend extension using elevation when they require higher-level permissions than the calling identity has.
Frontend: Call SDK methods from a headless frontend with a visitor or member identity.
Frontend with elevation: Call SDK methods from a headless frontend using elevation when they require higher-level permissions than the calling identity has.
Self-managed headless projects let you build a custom frontend with any framework while using Wix backend services. You're responsible for hosting and authentication.
In self-managed headless projects, you must create a Wix client with an appropriate authentication strategy.
Choose the tab that matches your use case:
Visitor or member: Call SDK methods with a visitor or member identity.
Admin: Call SDK methods with admin-level permissions using an API key.
Wix Blocks is a visual editor for building Wix apps. You can create widgets, dashboard pages, and other app components using drag-and-drop design tools and custom code.
In Wix Blocks, authentication is handled automatically. You don't need to create a Wix client.
Choose the tab that matches your use case:
Widget: Call SDK methods from a widget with a visitor or member identity.
Widget with elevation: Call SDK methods from a widget using elevation when they require higher-level permissions than the calling identity has.
Dashboard page: Call SDK methods from a dashboard page with a Wix user identity.