- AppBridge: Runtime SDK that enables bidirectional communication between your app (in an iframe) and the host environment (JTL Hub or ERP Cloud).
- Platform UI: React component library for building interfaces that match JTL’s design system.
AppBridge Communication
The AppBridge is provided by the@jtl-software/cloud-apps-core package. It establishes a secure communication channel between your app’s frontend (running in an iframe) and the host JTL environment (JTL Hub or ERP Cloud).
The bridge lets your app request data (like session tokens) and call host methods. Publish/subscribe event handling is in development (see below).
Installation
Initializing the AppBridge
Initialize the AppBridge before rendering your React app, then pass the instance as a prop or store it in context:Communication Flow
The AppBridge creates a two-way channel: your app’sappBridge instance communicates with a corresponding hostAppBridge instance inside the JTL Cloud service.
All communication is asynchronous and non-blocking. Your app continues executing while messages are delivered between the iframe and the host. There are no HTTP requests or polling involved.
API Reference
The AppBridge provides two main interfaces: methods (expose/call) and events (publish/subscribe).- Methods
- Events
AppBridge methods provide a request/response channel between your app and the host. There are two directions:Once available, exposing methods will let the host invoke logic that lives in your app. For example, a
- Call host methods (available today): your app invokes functions the host exposes, like
getSessionToken. See Environment-specific Methods for the full list. - Expose methods to the host (in development): your app registers functions that the host can invoke by name, used for things like custom calculations or data lookups.
Calling Host Methods
Invoke a function provided by JTL. The call returns a promise that resolves with the host’s result.Exposing Methods to the Host
In development:
method.expose and method.isExposed are in active development and not yet available. This section will be updated when the API ships.calculateShippingCost function the ERP calls before showing a quote, or a validateOrder hook called before checkout. The shape will follow a name + handler registration pattern with a disposer for cleanup, mirroring the event subscription model.Method API Summary
The table marks which APIs are available today and which are planned.Environment-specific Methods
JTL exposes different built-in methods depending on which environment your app is running in.- Setup Environment (JTL Hub)
- ERP Environment (ERP Cloud)
These methods are available when your app loads via the
lifecycle.configurationUrl during installation:getSessionToken is available in both environments. It’s the primary way your frontend identifies the current user and tenant. For details on verifying session tokens on your backend, see Authentication & Login.Reading Panel Context
Panels can read the current entity in context. On the customer view, callgetCurrentCustomerId to read the current customer, and subscribe to the CustomerChanged event to be notified when it changes.
CustomerChanged payload is an object of the form { customerId: string }. It’s emitted whenever the merchant selects a customer from the customer list, and not on unrelated views. Guard against an empty customerId before loading customer-specific data.
Naming Conventions
AppBridge APIs follow these conventions:- Host methods use camelCase verbs, for example
getCurrentCustomerId. - Events use PascalCase and describe completed actions, for example
CustomerChanged. - Event payloads are always objects, for example
{ customerId }, rather than primitive values. This lets new fields be added later without breaking existing subscribers.
Platform UI Components
JTL provides a React Component Library that matches the platform’s design system. Using these components ensures your app looks and feels consistent with the rest of the JTL interface.Installation
Available Components
The library includes form controls, layout containers, and typography components. Here’s the full list: Layout componentsBox,Grid,Stack,Layout,LayoutSection,Card
Button,Checkbox,Input,InputOTP,Radio,Select,Textarea,Switch,Toggle,ToggleGroup,FormGroup,Form
Text,Badge,Avatar,Table,DataTable,Progress
Link,Breadcrumb,Tab,Dropdown
Alert,Dialog,AlertDialog,Tooltip,Skeleton
Icon,Separator,ScrollArea,Collapsible,Popover,Sheet
Usage
Import components directly from the package:What’s Next
Authentication & Login
Implement OAuth 2.0 and session token verification in your app.
Using Platform APIs
Call the JTL Cloud REST and GraphQL APIs from your backend.
Handling Webhooks
Respond to events and AppBridge messages.
Best Practices
Patterns for AppBridge initialization, error handling, and production
readiness.