[SalesForce] Lightning component in this managed package must be marked ‘access=global’

I am about to upload a lightning component added to my package that embeds a canvas app. While trying to upload this package I am getting this error : The Lightning Component Definition in this managed package must be marked 'access=global'.

Why is that?
I know that default is public if not specified which is what I went for.
Also, this is what is meant by Public: Only components in the same namespace can set the value of this attribute. So I dont know why does it need to be global when releasing a managed package.?

Thank you.

Best Answer

A component's public and global access per documentation states:

public - Available within your org only. This is the default access value.

global - Available in all orgs.

So if you are releasing a component as part of a package, then you definitely want your component to be accessible outside of your org, for which you would need to mark it with a global access. The documentation on the access control mentions this in detail.

Mark your resources, such as a component, with access="global" to make the resource usable outside of your own org. For example, if you want a component to be usable in an installed package or by a Lightning App Builder user or a Community Builder user in another org.

Related Topic