> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate a shared app to isolated

> Workspace builder: move a deployed shared app to the isolated format by replacing its platform imports, then deploy it as isolated.

Use this procedure to move a Builder app from the **shared** format (it uses the platform's modules at runtime) to the **isolated** format (it embeds its libraries and reaches the platform through the `app` object). When it succeeds, the app deploys as isolated and keeps its webhooks, events and signed-in user. For what an isolated app can do, see [Build an app that calls your workspace](https://docs.prisme.ai/products/ai-builder/isolated-apps.md).

```mermaid theme={null}
flowchart LR
  A["Deploy, App format: Isolated"] --> B{"Compiles?"}
  B -->|"yes"| C["Deployed as isolated"]
  B -->|"no"| D["Migration card: imports to replace"]
  D --> E["Replace imports in the code"]
  E --> A
  D -->|"Keep Shared"| F["Deploys as shared"]
```

## Before you begin

* **Who:** a workspace builder with edit access to the workspace in Builder.
* **Where:** Builder, **Pages** section, **Deploy** dialog.
* **Requires:** an app already deployed in the shared format. An app deployed as isolated, or started from the isolated starter, has no format choice.
* **Impact:** until a deployment as isolated succeeds, the version online does not change.

## Migrate the app

**1. Try an isolated deployment**

Select **Deploy** in the header. Under **App format**, select **Isolated**, then select **Deploy**. If the app compiles, it is deployed as isolated and the migration is done.

**2. Read the migration card**

If the app does not compile, the card **This app cannot deploy as isolated yet** groups what blocks it: **Platform modules to replace**, **Packages not provided to isolated apps** and **Code errors**. Each entry names the import and the files that use it.

**3. Replace each import**

Select a file name in the card: the dialog closes and the file opens in the editor. Replace the import as shown in the table below.

**4. Deploy again**

Select **Deploy**, keep **Isolated**, then select **Deploy**. Repeat until the dialog confirms `Deployed v<version>`.

When the Builder assistant is available, you can let it make the changes: select **Migrate with the assistant** in the card. The assistant panel opens with the list of blocking imports. Review its changes before you deploy.

## Replace the platform modules

| Import in the shared app | Replacement in the isolated app |
| - | - |
| `@/lib/staticRuntime` (`createStaticApp`, `Link`) | The router of the isolated starter (`src/lib/router.tsx`), and `app.webhooks.call` for API calls |
| `@prisme.ai/sdk`, `@/lib/sdk`, `@/hooks/useWorkspace` | `app.webhooks.call`, `app.events.on` and `app.events.emit`, `app.user` |
| `@/hooks/useAuth` | `app.user` |
| `@prisme/ui`, `@/components/ui/*`, `@/lib/utils` | A copy of the component in the app (`src/components`), built on the provided libraries |
| Any other platform module | The matching method of the `app` object |

A package that the platform does not provide must be removed or replaced with a provided library. The list of provided libraries is in [Use the provided libraries](https://docs.prisme.ai/products/ai-builder/isolated-apps.md#use-the-provided-libraries).

## Verify the result

1. Open the **Deploy** dialog again. The **App format** section no longer appears: the app is isolated.
2. Open `/apps/<workspace slug>` and run the actions that call your automations. They answer as before the migration.

## Undo the change

To stay in the shared format, select **Keep Shared** in the migration card, then select **Deploy**. The app deploys as shared. After a successful isolated deployment, the format cannot be switched back from the dialog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.