
Updated June 17, 2026 by Sunny Chauhan, Salesforce Platform Developer II.
This is the AppExchange pitfall that quietly costs ISVs money: by default, Lightning Web Components in your Managed Package don't enforce your license. A customer's user without an active license can still see your LWCs, interact with them, and consume your product's functionality. The customer's seat-count math you negotiated in the contract? Doesn't match the actual usage in their org. The fix is one line of Apex per component, but most ISVs ship without it because the Salesforce documentation buries the gotcha.
Pro Tip
TL;DR By default, Lightning Web Components in Managed Packages don't enforce licensing. Any user can see and use them, licensed or not. The fix: call
UserInfo.isCurrentUserLicensed(namespace)orUserInfo.isCurrentUserLicensedForPackage(packageID)from an Apex controller backing the LWC, and gate rendering on the result. Two lines of code, applied per packaged LWC. Required for any paid AppExchange app where seat-count licensing matters (ProvenWorks, LWC in managed packages).
What the default actually does
You ship a Managed Package with three LWCs: a custom dashboard, a record-creation form, and an inline editor. Customer installs your app, you provision 50 license seats via the License Management App. The customer assigns those 50 seats to specific users.
Without the fix, here's what actually happens: any of the customer's 500 total Salesforce users can drop your LWCs onto a Lightning App Page, interact with them, see the data they expose, and use the functionality. The LMA tracks the 50 license seats, but it doesn't gate component access. Salesforce's licensing enforcement is permission-set-based for Apex and tab-based for the UI, but LWCs don't ship with that gating by default.
The 450 unlicensed users get free access to the components you sold the customer 50 seats for.
Pro Tip
The Salesforce documentation states this explicitly: "By default, LWC doesn't automatically enforce managed package licensing, and users can see and use Lightning web components in a managed package even if they don't have active licenses for that package."
The fix
The Apex method UserInfo.isCurrentUserLicensed(namespace) returns a Boolean indicating whether the current user has an active license for the specified namespace. Use it from an Apex controller that backs your LWC, gate the component's rendering on the result, and you've enforced licensing.
A minimal pattern:
``apex public with sharing class MyAppController { @AuraEnabled public static Boolean checkUserLicense() { return UserInfo.isCurrentUserLicensed('your_namespace'); } } ``
In your LWC:
```javascript import { LightningElement, wire } from 'lwc'; import checkUserLicense from '@salesforce/apex/MyAppController.checkUserLicense';
export default class MyComponent extends LightningElement { isLicensed = false;
@wire(checkUserLicense) wiredLicense({ data }) { if (data === true) { this.isLicensed = true; } } } ```
Then in the template:
``html <template> <template lwc:if={isLicensed}> <!-- Your component content --> </template> <template lwc:else> <!-- Optional: a "contact your admin for a license" message --> </template> </template> ``
Three small things. Apex controller method. Wire call in the LWC. Conditional render in the template. Apply this pattern per packaged LWC and the licensing actually works the way the customer expects.
When to use isCurrentUserLicensed vs isCurrentUserLicensedForPackage
Two methods. Most ISVs only need the first.
→ UserInfo.isCurrentUserLicensed(namespace) checks license for the namespace. Use this for single-package products.
→ UserInfo.isCurrentUserLicensedForPackage(packageID) checks license for a specific package by ID. Use this when you have multiple Managed Packages under the same namespace (a modular product with separately-licensed add-ons).
For single-package ISVs, isCurrentUserLicensed(namespace) is the right call. For modular products, isCurrentUserLicensedForPackage(packageID) lets you license add-ons independently.
Why ISVs ship without this fix (and what it costs them)
I've watched this play out across the founders I work with at Appnigma. The pattern:
1/ ISV ships a Managed Package with LWCs, doesn't add the license check 2/ Customer installs and provisions a modest number of seats 3/ Customer's users (licensed and unlicensed alike) start using the components 4/ ISV's product analytics show usage way above the licensed seat count 5/ ISV notices, runs the math, realizes the gap, and ships a patch with the license check 6/ Customer pushes back because their users have been using the product for months 7/ Renewal conversation gets complicated
The version where the ISV ships the license check from day one has none of those problems. The customer assigns seats, those users use the product, unlicensed users see the "contact your admin" prompt and either get a seat or move on.
The fix is two hours of work. Skipping it costs deals.
What about cross-package LWC consumption?
There's a related case: your Managed Package's LWC is consumed inside another package's custom LWC. The licensing check still applies. The Apex controller method runs in the context of the current user, and if that user doesn't have your license, the check returns false. The cross-package wrapper doesn't bypass the gate.
You should still test the cross-package scenario in a scratch org with users who have and don't have your license, because permission set propagation can behave unexpectedly when LWCs nest across namespaces.
Pre-flight checklist before submitting a paid LWC-heavy package for review
[ ] Identified every LWC in the package that exposes licensed functionality → Yes / No
[ ] Added the Apex controller license-check method per LWC → Yes / No
[ ] Wired the license check in the LWC component → Yes / No
[ ] Added the conditional render template logic → Yes / No
[ ] Tested with a licensed user in scratch org → Yes / No
[ ] Tested with an unlicensed user in scratch org → Yes / No
[ ] Tested cross-package consumption if your LWCs are exposed to other packages → Yes / No
[ ] Updated documentation to explain to customers what unlicensed users see → Yes / No
Frequently Asked Questions
Do LWCs in Managed Packages enforce licensing by default?
No. By default, any user can see and use Lightning Web Components packaged in a Managed Package, whether they have an active license or not. ISVs must add explicit licensing checks via UserInfo.isCurrentUserLicensed(namespace) to gate access (ProvenWorks, LWC in managed packages).
What's the difference between isCurrentUserLicensed(namespace) and isCurrentUserLicensedForPackage(packageID)?
isCurrentUserLicensed(namespace) checks license for the namespace, useful for single-package products. isCurrentUserLicensedForPackage(packageID) checks license for a specific package by ID, useful for modular products with separately-licensed add-ons sharing one namespace.
Does the licensing gap affect the Security Review?
Not directly. The Security Review doesn't require you to enforce licensing in your LWCs. It checks for CRUD/FLS, sharing, injection safety. Licensing enforcement is your commercial decision. But missing it costs you on customer renewals when usage exceeds licensed seats.
Where do customers see the unlicensed-user prompt?
Anywhere your LWC is exposed: Lightning App Pages, record pages, Home pages, App Builder targets, custom tabs. When the license check returns false, the conditional render in the template determines what shows. Most ISVs show a "contact your admin for a license" message.
Does the License Management App handle this?
The LMA tracks licenses and seat assignments. It doesn't enforce component access. License enforcement is the publisher's responsibility per component. The LMA tells you who's licensed; the Apex/LWC check applies the gate.
Can I add license enforcement to an existing Managed Package without a major version bump?
Yes. Adding the Apex controller method and updating the LWC counts as a patch update. You ship a new package version with the license enforcement and either let customers install or push upgrade it. Communicate the change to customers ahead of time so unlicensed users aren't suddenly locked out without warning.
Does this apply to Aura components too?
Aura components have similar default behavior. The fix is similar: call UserInfo.isCurrentUserLicensed from the component's controller. The pattern is the same as LWC, with Aura-specific syntax.
About the author
Sunny Chauhan is the founder and CEO of Appnigma AI, a no-code platform that generates Salesforce AppExchange-ready Managed Packages from natural-language prompts. He holds Salesforce certifications in Platform Developer II, Platform App Builder, Administrator, Data Cloud Consultant, and AI Associate. Since launching Appnigma in 2024, his team has helped B2B SaaS companies including Warmly, Hyperbound, Pylon, Seam AI, and Avoma ship native Managed Packages with proper license enforcement built into every component.
Originally published June 17, 2026. Last reviewed June 17, 2026. LWC licensing behavior verified against the Salesforce Lightning Web Components Developer Guide and the Use Components in Salesforce Targets documentation current as of the published date.
Related articles
Sources
1/ Salesforce Developers, Use Components in Salesforce Targets (LWC packaging) 2/ Salesforce Developers, Add Components to Managed Packages 3/ ProvenWorks, LWC in a managed package consumed from custom LWC 4/ Rodrigo Reboucas, Lightning Web Components: An ISV Partner Digest
How many LWCs in your current package check the user's license before rendering?
Ready to transform your Salesforce experience?
Start exploring the Salesforce Exchange today and discover apps that can take your CRM efficiency to the next level.
