Try Serpent Free
← Salesforce DevOps Glossary

Unlocked Package

A package that installs cleanly across orgs without Salesforce hiding its code or logic.

Definition

An unlocked package is a 2GP package type that bundles metadata into a versioned, installable artifact for internal, org-to-org distribution, without the code-hiding or namespace enforcement a managed package requires. Once installed, most components stay visible and editable in the subscriber org, and are cleanly removed on uninstall, unlike unmanaged metadata.

Building one means defining a package directory in sfdx-project.json, connecting a Dev Hub, and running sf package version create to produce an immutable version built from a fresh scratch org. Each version supports dependencies on other packages and tracked ancestry between releases.

The tradeoff is that nothing in an unlocked package is hidden, so it isn't a fit for shipping closed-source logic to paying customers, and teams still need a build pipeline to script version creation and promotion unless they adopt tooling that handles it for them.

In practice

How it works in Serpent

Serpent builds, versions, and promotes unlocked packages natively, without requiring teams to script sf package version create and dependency resolution by hand. Package directories, version numbers, and ancestry are managed through the UI, so a task's changes become a package version automatically as work is scoped and approved. Promotion between orgs, drift detection against installed versions, and rollback to a prior package version are handled the same way as any other release. See package development in Serpent for the full workflow.

Commit-to-package mapping in Serpent
Common questions

Unlocked Package, answered

Can subscribers see and edit the code in an unlocked package?
Yes. Unlocked packages don't hide code the way managed packages do, so most components stay visible and editable after install, though some metadata types can be marked protected.
Can I convert an unlocked package to a managed package later?
No. Package type is set when the package is created and can't be changed afterward, so switching to managed means building a new package.
Do unlocked packages support versioning and dependencies like managed packages do?
Yes. Since both use 2GP, unlocked packages support full version numbers, ancestry tracking, and dependencies on other packages, the same as 2GP managed packages.

Start free. No credit card, no install, no commitment.

Set up in under 15 minutes. No DevOps hire needed.

Curious about faster shipping before you dive in? Let's talk

Commitment free!