Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/mrt / cloneEnv

Function: cloneEnv()

cloneEnv(options, auth): Promise<{ }>

Defined in: packages/b2c-tooling-sdk/src/operations/mrt/env.ts:575

Clones an environment (target) from an existing source environment.

The new environment receives the source's configuration (excluding proxies and production flag) and is automatically deployed with the same bundle as the source target's current deployment (if any).

Parameters

options

CloneEnvOptions

Clone options

auth

AuthStrategy

Authentication strategy (ApiKeyStrategy)

Returns

Promise<{ }>

The newly created environment

Throws

Error if the clone fails

Example

typescript
const env = await cloneEnv({
  projectSlug: 'my-storefront',
  slug: 'staging-copy',
  fromSlug: 'staging',
  cloneRedirects: true,
  cloneEnvironmentVariables: true
}, auth);

Released under the Apache-2.0 License.