DEV Community

Cover image for How to Share a Salesforce Scratch Org
Aellon
Aellon

Posted on • Updated on

How to Share a Salesforce Scratch Org

A scratch org is a disposable deployment of Salesforce code and metadata. Sometimes it's helpful to share a scratch org with a teammate. In this scenario Person A wants to share their scratch org with Person B. Reasons for sharing an org include:

  • Collaboration on a ticket

  • Passing along an org that you no longer need so a teammate can jump right into development instead of spinning up a new org

Instructions

Person A gets the Auth Url to provide for Person B by doing the following:

  1. In the terminal run sfdx force:org:display -u <YourOrgUsername> --verbose and replace <YourOrgUsername> with your org username or simply sfdx force:org:display --verbose to use the default org.

  2. Copy the value for Sfdx Auth Url and give it to Person B. The value will have the format "force://@" or "force://::@".

SFDX Force Org Display Verbose Example

Then Person B stores the Auth Url by doing the following:

  1. Create an auth.key file.

  2. Open that file with vscode or another text editor

  3. Add the Auth Url provided by Person A

  4. Save the file. It should looks something like this:AuthUrl file example

  5. In the terminal run the command sfdx force:auth:sfdxurl:store -f ../auth.key where ../auth.key is the path to the file with the auth url info. This command will use that file to identify and connect to the scratch org.

  6. Open the org with the command sfdx force:org:open and voila! They're in Person A's org.

Related articles

Salesforce sfdxurl Commands

Top comments (0)