I am developing a ISV solution, which includes a LWC component, that can be used in all record pages.
To achive this, i made this metadata:
<?xml version="1.0" encoding="UTF-8"?> <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> <apiVersion>45.0</apiVersion> <description>abc</description> <isExposed>true</isExposed> <masterLabel>abc</masterLabel> <targets> <target>lightning__RecordPage</target> </targets> <targetConfigs> <targetConfig targets="lightning__RecordPage"> <objects> <object>Account</object> </objects> </targetConfig> </targetConfigs> </LightningComponentBundle>
As you can see, this component can be used on the Account record page now. But as i stated before, we are ISV and we want to enable admins to use this component on all kinds of objects, including custom objects which we don't know on beforehand.
One of the solutions i thought of is wrapping the LWC component in a Aura component, where you can expose a component to all possible custom/standard object record pages. In Aura it's sufficient to include the (implements="flexipage:availableForRecordHome"):
<aura:component implements="flexipage:availableForRecordHome" access="global"> <!-- This is the LWC component: --> <c:abc /> </aura:component>
But what if you want a native LWC component, is there a way to achive this?