# @pimcore/portal-plugin-sdk

Types for building a **Pimcore portal frontend plugin**: every slot, action surface, component
and service the portal exposes.

The package ships no JavaScript for that surface. The runtime arrives from the portal host over
Module Federation at page load, so host and plugins share one React, one DI container and one
antd theme.

> **Not on npm yet.** It currently ships inside the `pimcore/portal-engine` composer package.

## Install

```jsonc
{
  "dependencies": {
    // Comes from COMPOSER, not npm. Adjust the path to reach your app's vendor/.
    "@pimcore/portal-ui-kit": "file:../../vendor/pimcore/portal-ui-kit/frontend/portal-ui-kit",
    "@pimcore/portal-plugin-sdk": "^2026.3.0"
  }
}
```

`@pimcore/portal-ui-kit` is a peer and **is not on any registry** — it is delivered by the
`pimcore/portal-ui-kit` composer package, already built. Declare it as a `file:` path or the
install stops with `E404`, and nothing in that error mentions composer.

Do not work around it with `--legacy-peer-deps`: the install then succeeds and everything under
`ui.*` silently becomes `any` under `skipLibCheck`, so wrong shapes compile clean and render
nothing.

## Use

Name **this package** as your Module Federation remote — the host exposes `.`, so one specifier
serves both the types and the runtime:

```ts
// rsbuild.config.ts
remotes: {
  '@pimcore/portal-plugin-sdk':
    'portal_engine_host@/bundles/pimcoreportalengine/portal-frontend/static/js/remoteEntry.js'
}
```

```ts
import { componentRegistry, slots, ui, can } from '@pimcore/portal-plugin-sdk'
```

`resolve.alias` does not work here — an alias resolves on disk, and a federated module is not
there. The remote key is the only thing that rewrites the specifier.

## Documentation

Slots, action surfaces, permissions, tile regions, detail cards, lifecycle, serving your own
page and public shares:
[Portal Frontend Plugins](https://github.com/pimcore/portal-engine/blob/2026.3/doc/15_Development_Documentation/15_Customize_and_Extend_Behavior/16_Portal_Frontend_Plugins.md).

`etc/portal-plugin-sdk.api.md` in this package is the full public surface, generated from the
source and reviewed on every change.
