Sub topic 14
Local and Packaged Distribution
This chapter covers how an external client app (ECA) is distributed. It assumes you know the difference between ECA settings and policies from the previous chapter, and that you can work in Setup and run basic sf CLI commands.
What distribution state means
Every ECA has a distribution state. The state decides where the app can be used and who owns its configuration.
- Local means the app exists only in the org where you created it. Its settings and policies both live there.
- Packaged means the app was added to a package and installed in another org. The package carries the developer settings. The installing org keeps its own policies.
This split follows the settings and policies model. The developer controls what the app is, and each subscriber org's admin controls how it behaves in that org.
Local distribution
Use local distribution for integrations that serve a single org, such as an internal CI pipeline or a middleware service your company runs. You configure settings and policies in the same org. Nothing needs packaging.
You can still move a local app between your own sandboxes and production. Deploy it as metadata, which the next chapter covers.
Packaged distribution
Use packaged distribution when you build an app for other orgs, for example a product sold on AppExchange or a tool shared across business units that run separate orgs.
When a subscriber installs the package:
- The ECA arrives with its OAuth settings, such as the callback URL and selected scopes.
- The subscriber's admin reviews the app and sets policies, such as permitted users, IP relaxation, and refresh token behavior.
- Users can authorize only after the admin has approved access under those policies.
Compared with a packaged connected app, there is a safety benefit. The developer cannot change a subscriber's policies by shipping a new package version. The admin's choices stay in place.
Choosing between them
| Question | Local | Packaged |
|---|---|---|
| Who uses the app? | One org | Many orgs |
| Where are settings edited? | The same org as policies | The developer org, then shipped in the package |
| Who sets policies? | The org's admin | Each subscriber's admin |
| Typical case | Internal integration | Partner or vendor product |
Common mistakes
- Packaging an app that only one org needs. This adds version management with no benefit. Keep it local.
- Expecting to edit settings in a subscriber org. Developer settings come from the package. To change them, release a new package version.
- Reusing one consumer key across orgs by hand. Create the app once and distribute it as a package, so each org gets a consistent definition.
Exercise
Your company builds a reporting tool that 40 customer orgs will install. One customer wants a stricter IP range than the others. Which distribution state do you use, and where does the customer set the IP restriction?
Show answer
Use packaged distribution. The customer's admin sets the IP restriction in the policies of their own org after installing. The IP rule is a policy, not a developer setting, so it does not change for other customers and does not require a new package version.