@salesforce/b2c-tooling-sdk / operations/mrt
operations/mrt
Managed Runtime (MRT) operations.
This module provides functions for managing bundles and deployments on Salesforce Managed Runtime.
Bundle Operations
- createBundle - Create a bundle from a build directory
- pushBundle - Push a bundle to MRT (creates and uploads)
- uploadBundle - Upload a pre-created bundle
- listBundles - List bundles for a project
Usage
typescript
import { pushBundle } from '@salesforce/b2c-tooling-sdk/operations/mrt';
import { ApiKeyStrategy } from '@salesforce/b2c-tooling-sdk/auth';
const auth = new ApiKeyStrategy(process.env.MRT_API_KEY!, 'Authorization');
// Push and deploy a bundle
const result = await pushBundle({
projectSlug: 'my-storefront',
ssrOnly: ['ssr.js'],
ssrShared: ['**/*.js', 'static/**/*'],
buildDirectory: './build',
message: 'Release v1.0.0',
target: 'staging'
}, auth);
console.log(`Bundle ${result.bundleId} deployed to ${result.target}`);Authentication
MRT operations use API key authentication. Get your API key from the Runtime Admin dashboard.
Interfaces
- Bundle
- CreateBundleOptions
- CreateEnvOptions
- DeleteEnvOptions
- DeleteEnvVarOptions
- EnvironmentVariable
- EnvVarOptions
- GetEnvOptions
- ListEnvVarsResult
- PushOptions
- PushResult
- SetEnvVarOptions
- SetEnvVarsOptions
- WaitForEnvOptions