0

So, that's the question, can I make depending on an external managed package (i.e. an app from the app exchange) my second generation package?

1 Answer 1

2

Yes, you can. First, see Which Package Dependencies Work with Second-Generation Managed Packages?. The only real limitation here is that a 1GP cannot depend on a 2GP. Dependencies on Unlocked Packages are only "not recommended."

To actually know how do so, read Create Dependencies Between Second-Generation Managed Packages. In summary, you just use the package and version number, like this:

"dependencies": [ 
   {
      "package": "[email protected]"
   }
]
2
  • Thank you, but I have another question related. In "OtherOrgPackage" what is supposed I have to write? The namespace of the other package? Commented Dec 4, 2023 at 7:59
  • @FranMejias Namespaces for 2GP are not unique. If you use an alias in sfdx-project.json, it's the alias for the package version. You can also use the 0Ho package ID with a version number ([email protected]), or the 04t version ID (04t0000000ABcDE). You can find these ID values from sf package list if the package is installed in an org.
    – sfdcfox
    Commented Dec 4, 2023 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .