Wix JavaScript SDK

The Wix JavaScript SDK consists of npm packages containing wrapper functions for Wix REST APIs. These functions enable you to access and manage Wix functionality through function calls in your JavaScript code. When using the Wix JavaScript SDK, you only need to configure authentication once. You don’t need to handle it in every API call.

The Wix JavaScript SDK has two core modules - the SDK module (@wix/sdk) and the React SDK module (@wix/sdk-react).

The SDK module provides:

  • A client for executing authenticated API requests and handling webhooks.
  • Authentication strategies for API requests.
  • Features for working with media content returned by the APIs.

The React SDK module includes everything from the SDK module and enables the integration of Wix JavaScript SDK APIs within React components.

The Wix JavaScript SDK is easy to integrate into your app. You simply install a core module (@wix/sdk or @wix/sdk-react), and then backend modules for each Wix domain your app uses (such as @wix/contacts.)

Advantages of using the Wix JavaScript SDK

The Wix JavaScript SDK’s functions represent a simpler, cleaner alternative to REST API calls for Javascript developers.

It’s the natural choice if you’re building an app using the Wix CLI for Apps. The CLI is a tool for building Wix Apps, coded in Javascript, using commands in the terminal. It's a more streamlined alternative to building apps using the Wix Dev Center and is used by Wix's own developers to create Wix Apps.

The Wix JavaScript SDK is also a good option if you’re building a self-hosted app and coding in Javascript.

Authentication and permissions

Your Javascript SDK API calls must be authenticated using the OAuth protocol. You can authenticate either as an instance of your app, or on behalf of a user. For more information, see About Authentication.

Site owners must also grant your app explicit permission to access their data. They do this when they install your app on their site. Therefore, you must provide a list of permissions you need from the site owner in the Permissions page in the Wix Dev Center. You can see which permissions each endpoint requires in its Permissions Scopes section in the JavaScript SDK API reference.

Read more about permissions.

Events

The JavaScript SDK offers functionality for processing Wix webhook events. For an example, see Handle Events With Webhooks.

Service plugins

To integrate service plugins (formerly SPIs) into your app, you need to implement REST endpoints. For more information, see Service Provider Interfaces.

Was this helpful?
Yes
No