Install AI Tools

B2C Commerce tools, documentation, and skills for your assistant.

Claude

Install the plugin Recommended

bash
claude plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
claude plugin install b2c-dx-mcp@b2c-developer-tooling --scope project

Start a new Claude Code session in your project. Use --scope user instead for all projects.

Manual MCP setup

From your project directory:

bash
claude mcp add --transport stdio --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new session. Use --scope user instead for all projects. See Claude Code MCP setup.

Claude Desktop setup

Codex

Install the plugin Recommended

bash
codex plugin marketplace add SalesforceCommerceCloud/b2c-developer-tooling
codex plugin add b2c-dx-mcp@b2c-developer-tooling

Start a new Codex session in your project. This setup also works with the Codex IDE extension and the ChatGPT Work desktop app.

Manual MCP setup
bash
codex mcp add b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Or add this to ~/.codex/config.toml (or $CODEX_HOME/config.toml if customized):

toml
[mcp_servers.b2c-dx-mcp]
command = "npx"
args = ["-y", "@salesforce/b2c-dx-mcp@latest"]

Start a new session. See Codex MCP configuration.

ChatGPT online setup

VS Code

Install the plugin Recommended

  1. Open the Command Palette (Cmd/Ctrl+Shift+P) and run Chat: Install Plugin from Source.
  2. Enter SalesforceCommerceCloud/b2c-developer-tooling.
  3. Select b2c-dx-mcp and follow the installation prompts.
  4. Start a new chat in GitHub Copilot.
Manual MCP setup

Add this to .vscode/mcp.json in your workspace:

json
{
  "servers": {
    "b2c-dx-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

See VS Code MCP setup.

Copilot CLI setup

Cursor

Reload the MCP server in Cursor after installation.

Manual MCP setup

Add this to .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "b2c-dx-mcp": {
      "command": "npx",
      "args": ["-y", "@salesforce/b2c-dx-mcp@latest"]
    }
  }
}

For all projects, use ~/.cursor/mcp.json instead.

See Cursor's MCP documentation.

OpenCode

Add this to opencode.json in your project:

json
{
  "mcp": {
    "b2c-dx-mcp": {
      "type": "local",
      "command": ["npx", "-y", "@salesforce/b2c-dx-mcp@latest"],
      "enabled": true
    }
  }
}

Restart OpenCode. For all projects, use ~/.config/opencode/opencode.json. See OpenCode MCP setup.

Gemini

From your project directory, run:

bash
gemini mcp add --scope project b2c-dx-mcp -- npx -y @salesforce/b2c-dx-mcp@latest

Start a new Gemini CLI session. Use --scope user instead for all projects. See Gemini CLI MCP setup.

No separate skills plugins needed.

Other clients and manual setup →
Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / config / InstanceManager

Class: InstanceManager

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:44

Service for managing B2C instances across multiple config sources.

This class aggregates instance management operations from all sources that implement the optional instance management methods.

Example

typescript
import { InstanceManager, DwJsonSource } from '@salesforce/b2c-tooling-sdk/config';

const manager = new InstanceManager([new DwJsonSource()]);

// List all instances
const instances = manager.listAllInstances();

// Create a new instance
manager.createInstance({
  name: 'staging',
  config: { hostname: 'staging.example.com' },
  setActive: true,
});

Constructors

Constructor

new InstanceManager(sources): InstanceManager

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:45

Parameters

sources

ConfigSource[]

Returns

InstanceManager

Methods

createInstance()

createInstance(options, targetSource?): Promise<void>

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:92

Create an instance in the specified source (or default to first instance source).

Parameters

options

CreateInstanceOptions & ResolveConfigOptions

Instance creation options

targetSource?

string

Source name to use (optional, defaults to first available)

Returns

Promise<void>

Throws

Error if no instance sources available or specified source not found


getCredentialSources()

getCredentialSources(field): ConfigSource[]

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:81

Get sources that can store a specific credential field.

Parameters

field

keyof NormalizedConfig

The credential field to check

Returns

ConfigSource[]

Array of sources that can store the field


getInstanceSources()

getInstanceSources(): ConfigSource[]

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:71

Get sources that can create instances.

Returns

ConfigSource[]

Array of sources with createInstance() method


listAllInstances()

listAllInstances(options?): Promise<InstanceInfo[]>

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:53

List instances from all sources that implement listInstances().

Parameters

options?

ResolveConfigOptions

Resolution options

Returns

Promise<InstanceInfo[]>

Array of all instances from all sources


removeInstance()

removeInstance(name, options?): Promise<void>

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:121

Remove an instance from the source that contains it.

Parameters

name

string

Instance name to remove

options?

ResolveConfigOptions

Resolution options

Returns

Promise<void>

Throws

Error if instance not found in any source


setActiveInstance()

setActiveInstance(name, options?): Promise<void>

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:143

Set an instance as active in the source that contains it.

Parameters

name

string

Instance name to set as active

options?

ResolveConfigOptions

Resolution options

Returns

Promise<void>

Throws

Error if instance not found in any source


storeCredential()

storeCredential(instanceName, field, value, targetSource?, options?): Promise<void>

Defined in: packages/b2c-tooling-sdk/src/config/instance-manager.ts:168

Store a credential for an instance in the specified source.

Parameters

instanceName

string

Instance name

field

keyof NormalizedConfig

Config field to store

value

string

Value to store

targetSource?

string

Source name to use (optional)

options?

ResolveConfigOptions

Resolution options

Returns

Promise<void>

Throws

Error if no credential sources support the field