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

@salesforce/b2c-tooling-sdk / clients / createTlsDispatcher

Function: createTlsDispatcher()

createTlsDispatcher(options): Agent | undefined

Defined in: packages/b2c-tooling-sdk/src/clients/tls-dispatcher.ts:96

Creates an undici Agent with custom TLS options for mTLS/self-signed cert support.

Returns undefined if no TLS options are needed (default fetch behavior).

Parameters

options

TlsOptions

TLS configuration options

Returns

Agent | undefined

An undici Agent configured for TLS, or undefined if not needed

Examples

ts
// Client certificate authentication
const dispatcher = createTlsDispatcher({
  certificate: './my-cert.p12',
  passphrase: 'secret',
});
ts
// Self-signed certificate support
const dispatcher = createTlsDispatcher({
  rejectUnauthorized: false,
});

Released under the Apache-2.0 License.