Platform Workspace API

lightning/platformWorkspaceApi

Work with workspace tabs and subtabs in a Lightning console app using the lightning/platformWorkspaceApi module. The lightning/platformWorkspaceApi module requires API version 59.0 or later.

For Use In

Lightning Experience

The lightning/platformWorkspaceApi module provides LWC Workspace API methods to control workspace tabs and subtabs in a Lightning console app. All the methods in the lightning/platformWorkspaceApi module return a promise. Required method parameters are explicitly passed as individual arguments. Optional parameters are passed into an object as the last argument of the method.

To use the Workspace API in your component, import the functions in your component's JavaScript file.

The following example toggles the highlight of a focused tab in the Lightning console app.

For this module's documentation, see Methods for Workspace Tabs and Subtabs in Lightning Experience in the Console Developer Guide.

To work with Lightning console app events in your component, subscribe to the Lightning message channels for the Aura application events that you want to listen for.