Newer Version Available
Select the Locker API Version for an Org
We recommend updating your custom components to comply with the latest version, but we know that it can take some time. Your org could also depend on managed packages that third-party developers must update. Set Lightning Locker to use an older API version to give developers time to update their custom Lightning components and comply with Locker’s latest security enhancements.
Verify in sandbox orgs that custom components perform correctly with the Locker API version set to the latest. Then you can change the Locker API version to the latest in your production orgs to take advantage of the latest security enhancements.
Where the Locker API Version Is Used
Changing the Locker API version for the org affects all Lightning components used in the areas listed in What Does Lightning Locker Affect?. However, it doesn’t affect the Salesforce API version in components that set apiVersion in their configuration files. The Locker API version isn’t the same as the Salesforce API version. They use the same version number to indicate alignment with the same Salesforce release. The org setting for Locker API version can’t override the component’s minimum required Salesforce API version.
Locker API Version Changes
View the security changes in the API versions to help determine compatibility of your custom components.
| Locker API Version | Security Changes | Description |
| 50.0 | None | Lightning Locker changes in this release don’t impact custom components. |
| 49.0 | Restrict APIs used in $A.getCallback() | Lightning Locker wraps the $A.getCallback() function. JavaScript that is wrapped by $A.getCallback() must adhere to Locker’s security restrictions. See the Locker API Viewer for support status of JavaScript APIs in Lightning Locker. |
| 48.0 | Sanitize HTML inserted with execCommand | Lightning Locker sanitizes HTML that’s inserted using document.execCommand(insertHTML) to remove potentially malicious executable script content. |
| 47.0 | Reject import() expressions | Lightning Locker doesn't allow the import() expression because importing third-party code is a potential security risk. |
| Restrict the name and id properties of a HTML element | Lightning Locker doesn't allow the name or id attribute to be set to property names that are reserved for the DOM. | |
| 46.0 | All Locker security features | Supports all Lightning Locker features since its introduction, when it was called LockerService. This includes all features in version 37.0 (Spring '16) through version 46.0 (Summer '19) releases. |
Change the Locker API Version for Your Org
- From Setup, enter Session in the Quick Find box, and then select Session Settings.
- In the Locker API Version section, for the Use security enhancements in API version field, select the API version.
- Click Save.