Site API

The Site API enables code within Embedded Scripts and Site Widgets created with the CLI to interact with a Wix site. For example, you can access site data and interact with other Wix Apps, such as Wix Stores and Wix Bookings.

Note: This API is only available for use in Wix Apps that run within a Wix site environment. It isn't compatible with Velo code executed in the Wix Editor or on sites not hosted by Wix.

Setup

Install the @wix/site package using npm or Yarn:

Copy

or

Copy

Next, create a Wix Client with the relevant frontend modules. Supported modules are listed under Frontend Modules in the menu of this SDK reference. The following example uses the seo module:

Copy

Note: You can find your app ID in the OAuth page of the Wix Dev Center.

Finally, use the client constant to interact with the site via the frontend module. For example:

Copy
Did this help?