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:
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
.)
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 Wix JavaScript SDK is also a good option if you’re building a self-hosted app and coding in Javascript.
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 your app's dashboard. You can see which permissions each endpoint requires in its Permissions Scopes section in the JavaScript SDK API reference.
Read more about permissions.
The JavaScript SDK offers functionality for processing Wix webhook events. For an example, see Handle Events With Webhooks.
To integrate service plugins (formerly SPIs) into your app, you need to implement REST endpoints. For more information, see Service Provider Interfaces.