> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Introduction

## Article Link: https://dev.wix.com/docs/sdk/core-modules/sdk/introduction.md

## Article Content:

# SDK

The SDK module can be used to authenticate and communicate with the Wix platform from JavaScript code. It offers a client for making authenticated calls to the [Wix JavaScript SDK](https://dev.wix.com/docs/sdk/articles/get-started/about-the-wix-java-script-sdk.md) and [REST APIs](https://dev.wix.com/docs/rest.md).

<blockquote>
  When <a href="fallback::https://dev.wix.com/docs/develop-websites">extending.md sites</a> or building Wix apps with the <a href="portalId::63e3acd8-2a9c-421d-8f92-d02930eeb59eresourceId::20d79aa2-7e33-458c-a3f1-3d3bda5eaba8*fallback::https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/about-the-wix-cli-for-apps">CLI</a>.md or <a href="portalId::63e3acd8-2a9c-421d-8f92-d02930eeb59eresourceId::20c11ca2-7505-4d2d-b393-a271d509363e*fallback::https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-blocks/about-wix-blocks">Blocks</a>,.md most authentication is taken care of for you. Therefore, when developing on those platforms, you don't need to use this module to create a Wix client. Learn more <a href="fallback::https://dev.wix.com/docs/sdk/articles/set-up-a-client/about-the-wix-client">about.md the Wix Client</a>.
</blockquote>

The SDK module provides the following methods and objects:

* [WixClient](https://dev.wix.com/docs/sdk/core-modules/sdk/wix-client.md): A client for executing authenticated API requests and handling webhooks. The client employs the authentication strategy provided during initialization.
* [ApiKeyStrategy](https://dev.wix.com/docs/sdk/core-modules/sdk/api-key-strategy.md): Authenticates API requests for admin actions using an API Key.
* [OAuthStrategy](https://dev.wix.com/docs/sdk/core-modules/sdk/oauth-strategy.md): Authenticates API requests for Wix Headless using OAuth tokens.
* [AppStrategy](https://dev.wix.com/docs/sdk/core-modules/sdk/app-strategy.md):
  Authenticates API requests for apps using OAuth tokens. This strategy is only
  intended for [backend extensions](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/about-backend-extensions.md).
  To extend frontend environments such as the [dashboard](https://dev.wix.com/docs/sdk/host-modules/dashboard/introduction.md),
  [editor](https://dev.wix.com/docs/sdk/host-modules/editor/introduction.md),
  or [site](https://dev.wix.com/docs/sdk/host-modules/site/introduction.md),
  use [host modules](https://dev.wix.com/docs/sdk/host-modules/about-host-modules.md)
  instead.
* [media](https://dev.wix.com/docs/sdk/core-modules/sdk/media.md): Features for working with media content returned by Wix APIs.


## Setup
@package_metadata:@wix/sdk

To use the SDK module, install the `@wix/sdk` package. 

### Install the package

Follow the installation instructions for your development environment. 

| Development environment    | Installation method |
| -------------------------- | ------------------- |
| Wix sites (editor or IDE)  | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor.md). |
| Wix sites (local IDE)      | Run `wix install @wix/sdk` using the [Wix CLI](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-with-the-wix-cli.md). |
| Blocks apps                | Use the same installation method as Wix sites. |
| CLI and self-managed apps   | Run `npm install @wix/sdk` or `yarn add @wix/sdk`. |
| Headless sites and apps    | Run `npm install @wix/sdk` or `yarn add @wix/sdk`. |


## Authentication and permissions

SDK API calls must be authenticated using the OAuth protocol.

In Wix sites and [Wix-managed apps](https://dev.wix.com/docs/sdk/articles/get-started/about-the-wix-java-script-sdk.md#wix-hosted-apps) (CLI and Blocks), authentication is handled by Wix.  

In [self-managed apps](https://dev.wix.com/docs/api-reference/articles/platform-overview/about-self-managed-apps.md) and [headless projects](https://dev.wix.com/docs/api-reference/articles/platform-overview/about-headless-projects.md), you need to create and use a [Wix client](https://dev.wix.com/docs/sdk/articles/set-up-a-client/about-the-wix-client.md).

Depending on the context of your code, you may need to [elevate](https://dev.wix.com/docs/sdk/core-modules/essentials/auth.md) the method you want to call.

If you’re developing a wix App, you need to add permissions for the APIs you're calling in the [Permissions page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions) in your app's dashboard.