> 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: About the External Install Flow

## Article: About the External Install Flow

## Article Link: https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/about-the-external-install-flow.md

## Article Content:

# About the External Install Flow

The external install flow lets you trigger a Wix app installation from outside the Wix App Market, editor, or site dashboard. For example, from a published Wix site or non-Wix site. When triggered externally, Wix supports the functionality to specify a post-installation redirect, track custom state, and provides [OAuth credentials](#oauth-credentials) to simplify integrating external app services with Wix sites.

## How it works

To support the external install flow:

- Build an [installation URL](#about-the-installation-url) and expose it to site visitors, such as by attaching it to a button.
- Implement a [callback handler](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md) to receive the post-installation redirect.

When a site visitor navigates to the URL, the following flow starts:

1. Wix initiates the standard install flow.
2. After install, Wix redirects the site visitor to your callback URL and appends [query parameters](#what-wix-sends-in-the-redirect).
3. Your [callback handler](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md) receives the redirect. You can use the callback handler to verify the install succeeded, handle query parameters, and [manage authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth.md).

The external install flow also supports custom state, which is data you can pass as query parameters in the callback URL. Wix preserves your state throughout the external install flow and returns it to the callback handler.

Learn more about [setting up the external install flow](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md).

## About the installation URL

To start the external install flow, you must [build](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md) and expose an installation URL. Build the URL by appending query parameters to the base URL using standard [query string](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Web_mechanics/What_is_a_URL#parameters) syntax:

```
https://www.wix.com/app-installer
```

The installation URL supports the following query parameters:

| Query parameter | Required | Description |
|---|---|---|
| `appId` | Yes | The app ID of the app you want to install. Triggers the standard install flow for the specified app. |
| `postInstallationUrl` | No | Your callback URL, which you can specify at runtime. After the install completes, Wix redirects the Wix user to this URL and appends its own query parameters. Wix also preserves any query parameters you include. |
| `shareUrlId` | For unlisted apps | The unique ID for a [share install link](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/share-an-app-install-link.md). Required when your app is unlisted and you use the external install flow with `postInstallationUrl`. |

## Unlisted apps and share install links

For **unlisted** apps, site visitors install your app through a [share install link](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/share-an-app-install-link.md) you create in your app dashboard. Include the link's unique ID in the installation URL as `shareUrlId` so Wix can resolve the install path that would otherwise come from the App Market listing. Learn how to extract the ID and add it to your installation URL in [Set Up the External Install Flow](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md).

<blockquote class="important">

__Important:__
The `postInstallationUrl` must be an [encoded URI component](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent).

</blockquote>

## What Wix sends in the redirect

After the install completes, Wix redirects the Wix user to your `postInstallationUrl` and appends query parameters. [Implement a callback handler](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md) to receive and process them.

<blockquote class="important">

__Important:__
Your callback handler method must use HTTPS.

</blockquote>

The following table describes the query parameters Wix appends to the redirect URL:

| Query parameter | Description |
|---|---|
| `appId` | Your Wix app ID. |
| `tenantId` | The ID of the Wix site that installed the app. |
| `instanceId` | A unique ID for this app installation, sent as plain text in the redirect URL. |
| `signedInstance` | A signed and encoded copy of the app instance data, included on successful installs. |
| Custom state | Query parameters you included in the `postInstallationUrl`. |

For example, a redirect URL looks like this:

```
https://yoursite.com/wix/connect?appId=6fffd282-...&tenantId=d6e22aef-...&instanceId=3af764eb-...&signedInstance=ZT30j4OOOmGAHRVS9dewNDEd0augMyMiVZEssIgre1A.eyJpbnN0YW5jZUlkIjoi...
```

<blockquote class="warning">

__Warning:__ Verify `signedInstance` before you trust `instanceId` or store it. Query parameters can be forged, so `instanceId` on its own isn't proof of a successful install. [Parse and verify](https://dev.wix.com/docs/build-apps/develop-your-app/auth/app-instances/parse-the-app-instance-query-parameter.md) `signedInstance` to confirm the install, then treat `instanceId` as a permanent credential for this app-site connection and store it securely.

</blockquote>

## OAuth credentials

Use the `instanceId` from your callback handler to [create OAuth access tokens](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/authenticate-using-oauth.md) that grant access to the permissions you've defined in your [app dashboard](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app.md) and enable your backend to call Wix APIs on behalf of the installed app.

## See also

- [Set Up the External Install Flow](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/set-up-the-external-install-flow.md)
- [Share an App Install Link](https://dev.wix.com/docs/build-apps/launch-your-app/app-distribution/install-your-app/share-an-app-install-link.md)
- [About OAuth](https://dev.wix.com/docs/build-apps/develop-your-app/access/authentication/about-oauth.md)