> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/lwc-container/embed-a-managed-package-component.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Embed a Managed Package Component

Check whether a managed package or OmniStudio component loads in the LWC Container, embed it by namespace, and wrap it in your own LWC when it does not.

Your org runs an industry cloud or an ISV app that ships its own components, say an account health card from a vendor, and you want it on the same page as the accounts table. The LWC Container loads a managed package LWC the same way it loads your own, by its namespace and name. Check the component first: some load directly, others need a small wrapper LWC.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FWmA6Ol6KLOan0FSNI0Yr%2Flwc-container-embed-a-managed-package-component-result.png?alt=media" alt="An LWC Container showing the My Assigned Surveys component of a third-party managed package, loaded by its namespace and name" width="563"><figcaption><p>A managed package component, loaded by its namespace and name.</p></figcaption></figure>

## Before you start

* The managed package installed in your sandbox, and the namespace and API name of the component you want. The vendor's documentation or your package metadata gives both.
* A Dynamic Component with an LWC Container. [Pass a Selected Row to an LWC](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/lwc-container/pass-a-selected-row-to-an-lwc.md) builds one beside an accounts table.

## Which components load

The container loads any Lightning Web Component deployed with `isExposed` set to `true` in its `.js-meta.xml`. A vendor's component follows the same rule as your own.

| Component                                            | Loads?            | What to do                                                                                                                             |
| ---------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Managed package LWC (Industries clouds, ISV apps)    | Yes, when exposed | Name it `namespace/componentName`. Some vendors limit which `@api` properties you can set.                                             |
| OmniScript or FlexCard on the LWC runtime            | May load          | It is deployed as an LWC: try its LWC name, then fall back to a wrapper.                                                               |
| OmniScript or FlexCard on the legacy Vlocity runtime | No                | Migrate it to the LWC runtime first, then try its LWC name.                                                                            |
| Aura component                                       | No                | Ask the vendor whether an LWC version exists.                                                                                          |
| Screen Flow                                          | No                | Use the [Flow](https://docs.avonnicomponents.com/dynamic-components/components/flow.md) component: it maps input and output variables. |

{% hint style="info" %}
If you are not sure a component is an exposed LWC, check its `.js-meta.xml` in the package metadata, or ask the vendor.
{% endhint %}

## Build it

Choose how you want to build:

✨ **Build with AI**: give your AI assistant a ready-to-use prompt.

🛠️ **Build with clicks**: follow the steps in the builder yourself.

{% tabs %}
{% tab title="Build with AI" icon="wand-magic-sparkles" slug="embed-a-managed-package-component-build-with-ai" %}
Your assistant checks the package component and drafts the container with the `avonni-dynamic-components` skill; the managed package must already be installed in your sandbox.

{% stepper %}
{% step %}

### Set up the Avonni Skills and MCP server

Follow [Setup](https://docs.avonnicomponents.com/dynamic-components/build-with-ai/setup.md) to install the Avonni Skills, connect your AI assistant to the Avonni MCP server, and sign in to your sandbox through Salesforce CLI.

Have the namespace and the component name from the vendor's documentation at hand.
{% endstep %}

{% step %}

### Copy the prompt and review the plan

Paste the prompt into your configured assistant. Check the target org and the field mappings in its plan before you approve it.

{% prompt description="Prompt for this tutorial" icon="wand-magic-sparkles" openInAIProviders="false" defaultExpanded="partial" %}
{% code overflow="wrap" collapsedlinecount="10" %}

```
Use the avonni-dynamic-components skill. Verify the LWC Container component and its LWC Name and LWC Attributes properties against the Avonni MCP server.

Inspect my sandbox: confirm that the managed package with the namespace [namespace] is installed, that it contains a Lightning Web Component named [componentName], and whether that component is exposed. List the public properties the vendor documents for it. If it is not an exposed LWC, stop and tell me.

In my Dynamic Component that holds the AccountsTable Data Table, add an LWC Container with LWC Name [namespace]/[componentName]. If the component takes a record Id, add one LWC Attributes item with that property's name and the Value {!AccountsTable.firstSelectedRowSObject.Id}.

Show me the plan and the field bindings before writing files. Then draft the local metadata, list what is left for me to set up by hand, and stop before deployment or activation.
```

{% endcode %}
{% endprompt %}
{% endstep %}

{% step %}

### Deploy to the sandbox and check the result

Review what the assistant generated and what it left for you to configure. Deploy the approved files to your sandbox only, finish any remaining setting with the **Build with clicks** tab, then check in Preview that the vendor's component renders inside the container.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Build with clicks" icon="screwdriver-wrench" slug="embed-a-managed-package-component-build-with-clicks" %}
{% stepper %}
{% step %}

### Find the component's name

Get the namespace and the API name from the vendor. A component named `accountHealth` in a package with the namespace `vendorns` is `vendorns/accountHealth`.
{% endstep %}

{% step %}

### Point the container at it

1. Drag an **LWC Container** next to the accounts table.
2. Set **LWC Name** to `vendorns/accountHealth`.
   {% endstep %}

{% step %}

### Pass the values it needs

In **LWC Attributes**, add one item per public property the vendor documents. For a component that takes an account, **Name** is the property name the vendor gives (for example `recordId`) and **Value** is `{!AccountsTable.firstSelectedRowSObject.Id}`.
{% endstep %}

{% step %}

### Save and test

Save, then open Preview and select an account. The vendor's component renders inside the container. If the container shows "Errors while loading LWC component" instead, check the name once, then see the wrapper pattern below and the troubleshooting section.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FYfVLxgR1McmOXJe4c9CP%2Flwc-container-embed-a-managed-package-component-error.png?alt=media" alt="The LWC Container showing the error illustration for a component that could not be loaded" width="563"><figcaption><p>What the container shows when it cannot load the component.</p></figcaption></figure>
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

## When the name alone is not enough: the wrapper pattern

A developer writes a small LWC that you own, renders the vendor's exposed LWC inside it, and exposes `@api` properties for what it needs from the page. Use it when the exposed component does not load by name in the container, or when one of its properties needs a number, a boolean or an object: the container passes every typed value as text, and the wrapper can convert it first. You then embed the wrapper like any other LWC, with visibility rules, LWC Attributes and Custom Interactions.

{% code title="accountHealthWrapper.html" %}

```html
<template>
    <vendorns-account-health record-id={accountId}></vendorns-account-health>
</template>
```

{% endcode %}

{% code title="accountHealthWrapper.js" %}

```javascript
import { LightningElement, api } from 'lwc';

export default class AccountHealthWrapper extends LightningElement {
    @api accountId;
}
```

{% endcode %}

Deploy the wrapper with `isExposed` set to `true`, set **LWC Name** to `c/accountHealthWrapper`, and pass `accountId` in **LWC Attributes**. A wrapper cannot render an Aura component, a legacy-runtime OmniScript or FlexCard, or a component its vendor does not expose.

## Troubleshooting

<details>

<summary>"Errors while loading LWC component" with a name you are sure of.</summary>

The component is not exposed, or it is an Aura component or a legacy-runtime OmniScript or FlexCard. Check its `.js-meta.xml` or ask the vendor. A component the vendor does not expose cannot be used from outside its package, wrapper or not: ask for an exposed or LWC version. A legacy-runtime OmniScript or FlexCard needs migrating to the LWC runtime first.

</details>

<details>

<summary>The component loads but ignores a value.</summary>

The vendor may not expose that property for outside use. Check the property name against the vendor's documentation, case included.

</details>

## Related tutorials

* [Pass a Selected Row to an LWC](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/lwc-container/pass-a-selected-row-to-an-lwc.md): the LWC Attributes binding used here, on your own LWC.
* [React to an LWC Event](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/lwc-container/react-to-an-lwc-event.md): a wrapper you own can dispatch events the container acts on.
* [LWC Container](https://docs.avonnicomponents.com/dynamic-components/components/lwc-container.md): every setting of the container.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/components/lwc-container/embed-a-managed-package-component.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
