> 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`).
> - 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: Set Up a Headless Client

## Article: Set Up a Headless Client

## Article Link: https://dev.wix.com/docs/go-headless/authentication/setup/set-up-a-headless-client.md

## Article Content:

# Set Up a Headless Client

To call Wix APIs from your own site or app, register it with your Wix project as a headless client. Registering creates an OAuth app, which the client authenticates through: it identifies where API calls come from and lets Wix issue [visitor](https://dev.wix.com/docs/go-headless/authentication/visitors/authenticate-visitors-js-sdk.md) and [member](https://dev.wix.com/docs/go-headless/authentication/members/about-member-login.md) tokens through [OAuth 2.0](https://dev.wix.com/docs/go-headless/authentication/about-authentication.md), without anyone sharing their Wix login credentials with your code.

Create a headless client for each external client that interacts with your project. For example, if you're creating a site and a mobile app, create 2 headless clients, one for the site and the other for the mobile app. You can create a client manually in the dashboard, as described below, or programmatically by calling [Create OAuth App](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/create-oauth-app.md).

> **Note:** A [Wix-managed headless project](https://dev.wix.com/docs/go-headless/wix-managed-headless/about-wix-managed-headless.md) already has a client. The `appId` value in your project's `wix.config.json` file is its client ID. Create an additional client only if you need a separate one, for example for a mobile app alongside your site.

## Create a headless client

To create a headless client in the dashboard:

1. In your project dashboard, go to **Settings** > **Development & integrations** > [**Headless Settings**](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Foauth-apps-settings).

2. In the **Headless clients** section, click **Create New Client**.

   ![Click create new client](https://wixmp-833713b177cebf373f611808.wixmp.com/images/d5f1beb98e3cce1d83db5ba7089642c6.png)

3. Enter a name in the **Client name** field. Choose a name that identifies the client clearly. For example, if the client is a fitness-related smartwatch app, you can name it "Smartwatch Gym Client App".

   Once you enter a name, select the client type and click **Create & Continue**.

   ![Enter name and description](images/91f8e3296a525d333cd8425dd3a55004.png)

4. Select the stack you're using to call Wix APIs.

   ![Select your stack](https://wixmp-833713b177cebf373f611808.wixmp.com/images/4f624953996a4a27235f4d4c9dfd772c.png)

   Once you select the stack, the modal expands to display code snippets for 5 apps built by Wix. Each code snippet is customized for the stack that you choose. You can copy these snippets to help you get started working with Wix APIs.

   ![Code snippets example](https://wixmp-833713b177cebf373f611808.wixmp.com/images/73b0d6128ebdca27cc597699a4c67bde.png)

   Once you choose your stack and copy any snippets you need, click **Continue**.

5. Click **View Your Setup** to close the modal and view your project's **Headless Settings**. Optionally, you can test out API calls using one of the 2 options displayed:

   - **Test API calls in the JavaScript playground:** Clicking **Open Playground** opens a new modal that lets you select different APIs and methods, and test out calls to them using the client ID you just created.
   - **See an example site in CodeSandbox**: Clicking **Go to Sandbox** opens a new tab with a CodeSandbox project. The project contains complete code that makes calls to various APIs like eCommerce and Bookings. You can copy code straight from the example, or fork the project to start editing and testing your own code.

   ![Choose a testing tool](https://wixmp-833713b177cebf373f611808.wixmp.com/images/c7faf56de4ce48438ef5cb4bf54638d4.png)

6. In the **Headless clients** section, your new client now appears with its client ID.

   Copy the **Client ID** and use it to connect and authenticate with your Wix project. You can also retrieve the client ID later by returning to the **Headless Settings** page.

## Approve redirect URLs

Many external sites redirect visitors to Wix-hosted pages for processes such as authentication and checkout. Wix then returns the visitor to the external site. To protect data security, Wix only ever redirects visitors to site addresses you approve in the **URLs** section of your client's settings. If your external site redirects to Wix-hosted pages, provide approval for the following URLs:

- [**Allow Redirect Domains**](https://dev.wix.com/docs/go-headless/authentication/setup/allow-redirect-uris-and-domains.md): Domains that Wix can redirect visitors to from Wix-hosted pages.
- [**Login URL**](https://dev.wix.com/docs/go-headless/authentication/members/custom-login-page/set-your-custom-login-page-url.md): URL of your custom login interface, if you will develop one.
- [**Allow Authorization Redirect URIs**](https://dev.wix.com/docs/go-headless/authentication/setup/allow-redirect-uris-and-domains.md): URIs that Wix can redirect members back to after they complete the authorization process.

## See also

- [About Authentication](https://dev.wix.com/docs/go-headless/authentication/about-authentication.md)
- [Create an SDK Client with OAuth](https://dev.wix.com/docs/go-headless/authentication/setup/create-an-sdk-client-with-oauth.md)
- [Make Admin API Calls with Client Credentials](https://dev.wix.com/docs/go-headless/authentication/admin/make-admin-api-calls-with-client-credentials.md)
- [Allow Redirect URIs and Domains](https://dev.wix.com/docs/go-headless/authentication/setup/allow-redirect-uris-and-domains.md)