API Reference

Complete API reference for the @akinon/app-shell package, including components, hooks, and type definitions.

Components

AppShellProvider

The root provider component that manages micro-frontend communication and state.

import { AppShellProvider } from '@akinon/app-shell';

Props

Property
Type
Required
Default
Description

apps

RegisteredApp[]

Yes

-

List of registered micro-frontend applications

navigation

ShellNavigation

Yes

-

Navigation helper functions

data

ApplicationData

No

-

Shared data available to all clients

actions

ApplicationActions

No

-

Actions that clients can invoke


AppRenderer

Renders fullpage micro-frontend applications.

import { AppRenderer } from '@akinon/app-shell';

Props

Property
Type
Required
Default
Description

id

number

Yes

-

Unique identifier for the application

path

string

No

-

Path to append to the iframe src URL


PluginRenderer

Renders plugin micro-frontend applications in designated placeholders.

Props

Property
Type
Required
Default
Description

placeholderId

string

Yes

-

ID of the placeholder where plugin renders

params

ApplicationParams

No

-

Parameters to pass to the plugin


ModalRenderer

Renders micro-frontend content within a modal.

Props

Property
Type
Required
Default
Description

uuid

UUID

Yes

-

Unique identifier for the modal

path

string

Yes

-

Path to render within the modal

size

ApplicationModalSize

No

-

Size configuration


Hooks

useAppShell

Access the shell context for managing micro-frontend interactions.

Return Value: AppShellContextState

Property
Type
Description

apps

RegisteredApp[]

List of registered applications

configs

Map<number | UUID, ApplicationConfig>

Configuration per app

navigate

(payload: NavigationPayload) => void

Navigation function

frames

MutableRefObject<Map<number | UUID, HTMLIFrameElement>>

Iframe references

buses

MutableRefObject<Map<number | UUID, Framebus>>

Framebus instances

instances

Map<number | UUID, AppInstanceInfo>

App instances

modals

Map<UUID, number | UUID>

Modal UUID mappings

modalContext

Map<UUID, unknown>

Modal context data


Types

RegisteredApp

Describes a registered micro-frontend application.


ShellNavigation

Navigation helper interface.


ApplicationData

Shared data structure.


ApplicationActions

Actions that clients can invoke.


ApplicationModalSize

Modal size configuration.


ApplicationParams

Parameters for plugin applications.


AppShellContextState

Context state returned by useAppShell.


AppInstanceInfo

Information about an app instance.


FullpageApplicationConfig

Configuration for fullpage applications.


PluginApplicationConfig

Configuration for plugin applications.


Events

AppShell uses the following events for communication (defined in @akinon/app-shared):

Event
Direction
Description

SET_CONFIG

Client → Shell

Client sends its configuration

SET_DATA

Shell → Client

Shell sends shared data

SET_APP_ID

Shell → Client

Shell sends app identifier

SET_MODAL_CONTEXT

Shell → Client

Shell sends modal context data

SET_HEIGHT

Client → Shell

Client sends its iframe height

SET_PARAMS

Shell → Client

Shell sends plugin parameters

INVOKE_ACTION

Client → Shell

Client invokes a custom action

INVOKE_DEFAULT_ACTION

Client → Shell

Client invokes a default action

NAVIGATE

Client → Shell

Client requests navigation

NAVIGATE_CHILD

Shell → Client

Shell triggers navigation on child app

ACTION_CONFIRMED

Shell → Client

Shell confirms an action (triggers onConfirm)

ACTION_CANCELED

Shell → Client

Shell cancels an action (triggers onCancel)

LOCALE_CHANGED

Shell → Client

Shell notifies locale change

Last updated

Was this helpful?