Newer Version Available

This content describes an older version of this product. View Latest

Review Org Setup

After you verify or configure the org details, you’re ready to go.

First, if you plan to use namespaces with your packages, complete these tasks.

If you’re creating a managed second-generation package, a namespace is required. If you’re creating a developer-controlled package, a namespace is optional.

Note

  1. Log in to the Dev Hub org you’re using for SFDX.
  2. Enable and deploy My Domain in the Dev Hub org.

    If you don’t enable and deploy My Domain, you can’t link your namespace to the Dev Hub org.

    Note

  3. From https://developer.salesforce.com/signup, create a Developer Edition (DE) org to use as your namespace org for testing.

    Unlike first-generation packaging, there’s no need to create a package or packaging org for second-generation packaging. You can create multiple test packages for a namespace by using the CLI and authenticating to the Dev Hub org.

    Note

  4. Log in to the namespace org, and specify a namespace. Use a disposable namespace, because you can use it only for testing. Use your real namespace later when you’re ready to adopt packaging for your production work.

    Most customers use a single namespace org but you can use more than one if you want more granular control over how you organize metadata. There can be a short delay between the time when you deploy My Domain and when the Link Namespace button appears in the Dev Hub.

    Note

  5. In the Dev Hub org, link each namespace you want to work with.
For all types of packages, complete these tasks from the CLI.
  1. Create a project and specify your configuration options in sfdx-project.json.
  2. Create a scratch org where you can develop, install, and test versions of your packages.
  3. (Recommended) Specify an alias for each org you plan to work with. An alias lets you give your orgs an easy to remember name so you can move between orgs easily while you work with packages.