Introduction

AppShell is the core library for building shell (host) applications in the UI Protocol ecosystem.

Introduction

It manages the integration of micro-frontend applications, handling data sharing, user actions, navigation, and communication.

What is a Shell Application?

A shell application is the host that embeds and manages micro-frontend clients. Examples include Omnitron and Seller Center. The shell provides:

  • Layout and Navigation - Header, sidebar, and routing

  • Shared Data - User info, permissions, configuration

  • Actions - Functions that clients can invoke

  • Communication Channel - Message passing via postMessage API

Key Responsibilities

Data Management

  • Share data with all connected micro-frontends

  • Synchronize state changes across applications

  • Maintain data isolation between different clients

User Actions

  • Define actions that clients can invoke (e.g., show toast, open modal)

  • Process action requests and return results

  • Handle built-in actions (navigation, UI helpers)

  • Manage routing for fullpage applications

  • Handle navigation requests from clients

  • Coordinate URL and query parameter changes

Application Lifecycle

  • Register and configure micro-frontend applications

  • Load/unload clients via iframes

  • Manage communication channels per client

Installation

Basic Setup

Wrap your application with AppShellProvider:

Provider Props

Prop
Type
Required
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

Custom actions that clients can invoke

Registered Apps

The apps prop contains the list of micro-frontend applications that can be rendered:

How It Works

  1. Shell initializes with AppShellProvider and registered apps

  2. Client iframe loads and sends SET_CONFIG event

  3. Shell responds with SET_DATA and SET_APP_ID

  4. Communication established via framebusarrow-up-right library

  5. Ongoing communication for actions, navigation, and data updates

Next Steps

Last updated

Was this helpful?