Managed Package Types
A package is a container that can be as small as an individual component or as large as a set of related apps. After creating a package, you can distribute it to other Salesforce users and orgs, including orgs outside of your company.
Developers can create unmanaged packages and managed packages. These package types have different use cases and characteristics.
Unmanaged packages are best suited for one-time drops of apps that require customization after installation. After the components are installed from an unmanaged package, the components can be edited in the org that they’re installed in. The developer who created and uploaded the unmanaged package has no control over the installed components, and can’t change or upgrade them.
Managed packages are ideal for commercial distribution through the AppExchange. Unlike unmanaged packages, package developers can upgrade managed packages and push these changes to subscriber orgs. Preserving the backwards-compatibility of managed packages is the package developer’s responsibility. However, Salesforce provides significant guardrails and tools that help package developers safely upgrade managed packages while minimizing the risk of introducing changes that may break existing code.
Salesforce supports first-generation managed packages (1GP) and second-generation managed packages (2GP). Salesforce also supports the conversion and migration of 1GP managed packages to 2GP managed packages. For new apps, we recommend using 2GP managed packages, as they allow for source-driven development and flexible versioning. See Why Switch to Second-Generation Managed Packaging and Comparison of First- and Second-Generation Managed Packages.
Apex classes and triggers from 1GP, 2GP, and migrated 2GP managed packages can behave differently depending on the managed package type. If a section of the Apex Developer Guide or the Apex Reference Guide doesn’t specify whether a behavior applies to only 1GP or 2GP, then it applies to all managed package types.