Developer Preview — This project is in active development. APIs may change. Provide feedback
Skip to content

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

Interface: ConfigSource

Defined in: packages/b2c-tooling-sdk/src/config/types.ts:195

A configuration source that can contribute config values.

Implement this interface to create custom configuration sources. Sources are called in order, and later sources can override earlier ones.

Example

typescript
import type { ConfigSource, ConfigLoadResult, ResolveConfigOptions } from '@salesforce/b2c-tooling-sdk/config';

class MyCustomSource implements ConfigSource {
  name = 'my-custom-source';

  load(options: ResolveConfigOptions): ConfigLoadResult | undefined {
    // Load config from your custom source
    return { config: { hostname: 'example.com' }, location: '/path/to/config' };
  }
}

Properties

name

name: string

Defined in: packages/b2c-tooling-sdk/src/config/types.ts:197

Human-readable name for diagnostics


priority?

optional priority: number

Defined in: packages/b2c-tooling-sdk/src/config/types.ts:210

Priority for source ordering. Lower numbers = higher priority.

Recommended ranges:

  • < 0: Before built-in sources (override defaults)
  • 0: Built-in sources (DwJsonSource, MobifySource)
  • 1-999: After built-in sources (fill gaps)
  • 1000: Lowest priority (PackageJsonSource)

Default

ts
0

Methods

load()

load(options): ConfigLoadResult | undefined

Defined in: packages/b2c-tooling-sdk/src/config/types.ts:218

Load configuration from this source.

Parameters

options

ResolveConfigOptions

Resolution options

Returns

ConfigLoadResult | undefined

Config and location from this source, or undefined if source not available

Released under the Apache-2.0 License.