Lightning Console JavaScript API (Pilot)

The Lightning Console JavaScript API provides JavaScript methods so that developers can programmatically control tabs, subtabs, and the utility bar in Lightning console apps. This feature is new in Lightning Experience.
Available in: Lightning Experience
Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions

Lightning console apps are available for an extra cost to users with Salesforce Platform user licenses for certain products. Some restrictions apply. For pricing details, contact your Salesforce account executive.


Note

Note

The Lightning Console JavaScript API is available as a developer preview. The Lightning Console JavaScript API isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. We can’t guarantee general availability within any particular time frame or at all. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don’t implement functionality developed with these commands or tools.

We also provide the Lightning Console JavaScript API to selected customers through a pilot program that requires agreement to specific terms and conditions. To be nominated to participate in the program, contact Salesforce. Pilot programs are subject to change, and we can’t guarantee acceptance. Make your purchase decisions only on the basis of generally available products and features. You can provide feedback and suggestions for the Lightning Console JavaScript API in the IdeaExchange.

This API brings the benefits of the Console Integration Toolkit, which works only in Salesforce Classic, to Lightning Experience and integrates with Lightning components used in Lightning console apps and the utility bar.

The Lightning Console JavaScript API has two libraries, the workspace API and the utility bar API. To use the libraries, include force:workspaceAPIAccess or force:utilitybarAPIAccess in your Lightning component, respectively. These components allow you to use API methods in the JavaScript controller of your component.

This Lightning component uses the workspace API to open a new tab.
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
  <force:workspaceAPIAccess aura:id="workspace" />
  <lightning:button label="Open Tab" onclick="{! c.openTab }" />
</aura:component>
This is the component’s controller.
({
  openTab : function(component) {
    var workspaceAPI = component.find("workspace");
    workspaceAPI.openTab({
      url: '#/sObject/001R0000003HgssIAC/view',
      focus: true,
    });
  },
})

When this component is added to a Lightning page used in a console app or utility bar, clicking the button will open a new tab with the specified relative URL.

This is what the component looks like as part of a case detail page in a Lightning console app.

A Lightning console app that utilizes the workspace API.