Skip to content

ensureScratchOrgSession

ensureScratchOrgSession(authFields, options): Promise<void>

Defined in: packages/simply-cicd-core/src/build/scratchOrgAuth.ts:38

Ensures the scratch org recorded in SCRATCH_ORG_INFO.json has a live session, using whichever renewable credential it actually has.

A scratch org whose Dev Hub authenticated via web/SFDX auth-url gets its own refreshToken at creation time (Salesforce’s OAuth “web server” flow always returns one) — that’s used directly via @salesforce/core, no shell-out. A JWT-authenticated Dev Hub never produces a refresh token (JWT bearer grants don’t have one), so that case still falls back to the existing authenticateOrg() JWT re-auth.

string

string

Present alongside refreshToken for a custom connected app.

string

string

string

Present when the owning Dev Hub wasn’t JWT-authenticated.

string

EnsureScratchOrgSessionOptions

Promise<void>