@salesforce/b2c-tooling-sdk / operations/mrt / pushBundleV2
Function: pushBundleV2()
pushBundleV2(
options,auth):Promise<PushV2Result>
Defined in: packages/b2c-tooling-sdk/src/operations/mrt/push.ts:294
Builds a v2-format archive from a build directory and uploads it to MRT.
This is upload-only: it does not deploy the bundle. Deploy separately with createDeployment (or the b2c mrt bundle deploy <bundleId> command).
Parameters
options
v2 push configuration options
auth
Authentication strategy (ApiKeyStrategy)
Returns
Promise<PushV2Result>
Result of the upload operation
Throws
Error if the upload fails
Example
typescript
import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
import { pushBundleV2 } from '@salesforce/b2c-tooling-sdk/operations/mrt';
const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
const result = await pushBundleV2({
projectSlug: 'my-storefront',
ssrOnly: ['ssr.js'],
ssrShared: ['static/**/*'],
buildDirectory: './build',
message: 'Release v1.0.0'
}, auth);
console.log(`Bundle ${result.bundleId} uploaded to ${result.projectSlug}`);