Skip to main content

@idpass/data-collect-core / getAdapterConfigValue

Function: getAdapterConfigValue()

getAdapterConfigValue<T>(config, fieldName, defaultValue?): T | undefined

Defined in: interfaces/types.ts:806

Helper to get adapter configuration values with fallback to legacy extraFields. Tries adapterConfig first, then falls back to extraFields for backwards compatibility.

Type Parameters

T

T extends string | number | boolean

Parameters

config

ExternalSyncConfig

The external sync configuration

fieldName

string

The field name to retrieve

defaultValue?

T

Optional default value if field is not found

Returns

T | undefined

The field value or default value

Example

const clientId = getAdapterConfigValue<string>(config, "clientId");
const batchSize = getAdapterConfigValue<number>(config, "batchSize", 50);