Function: createCore()
Prefactor TypeScript SDK / @prefactor/core / createCore
Function: createCore()
Section titled “Function: createCore()”createCore(
config,options?):CoreRuntime
Defined in: packages/core/src/create-core.ts:33
Creates a fully initialized core runtime from validated SDK configuration.
Parameters
Section titled “Parameters”config
Section titled “config”Resolved SDK configuration.
transportType
Section titled “transportType”"http" = ...
Transport type to use for span emission
sampleRate
Section titled “sampleRate”number = ...
Sampling rate (0.0 to 1.0)
captureInputs
Section titled “captureInputs”boolean = ...
Whether to capture span inputs
captureOutputs
Section titled “captureOutputs”boolean = ...
Whether to capture span outputs
maxInputLength
Section titled “maxInputLength”number = ...
Maximum length for input strings
maxOutputLength
Section titled “maxOutputLength”number = ...
Maximum length for output strings
httpConfig?
Section titled “httpConfig?”{ apiUrl: string; apiToken: string; agentId?: string; agentIdentifier?: string; agentName?: string; agentDescription?: string; agentSchema?: Record<string, unknown>; requestTimeout?: number; maxRetries?: number; initialRetryDelay?: number; maxRetryDelay?: number; retryMultiplier?: number; retryOnStatusCodes?: number[]; } = ...
HTTP transport configuration (required if transportType is ‘http’)
httpConfig.apiUrl
Section titled “httpConfig.apiUrl”string = ...
httpConfig.apiToken
Section titled “httpConfig.apiToken”string = ...
httpConfig.agentId?
Section titled “httpConfig.agentId?”string = ...
httpConfig.agentIdentifier?
Section titled “httpConfig.agentIdentifier?”string = ...
httpConfig.agentName?
Section titled “httpConfig.agentName?”string = ...
httpConfig.agentDescription?
Section titled “httpConfig.agentDescription?”string = ...
httpConfig.agentSchema?
Section titled “httpConfig.agentSchema?”Record<string, unknown> = ...
httpConfig.requestTimeout?
Section titled “httpConfig.requestTimeout?”number = ...
httpConfig.maxRetries?
Section titled “httpConfig.maxRetries?”number = ...
httpConfig.initialRetryDelay?
Section titled “httpConfig.initialRetryDelay?”number = ...
httpConfig.maxRetryDelay?
Section titled “httpConfig.maxRetryDelay?”number = ...
httpConfig.retryMultiplier?
Section titled “httpConfig.retryMultiplier?”number = ...
httpConfig.retryOnStatusCodes?
Section titled “httpConfig.retryOnStatusCodes?”number[] = ...
failureHandling?
Section titled “failureHandling?”{ onFatalError?: (error) => void; } = ...
Optional failure handling callbacks.
failureHandling.onFatalError?
Section titled “failureHandling.onFatalError?”(error) => void = ...
options?
Section titled “options?”CreateCoreOptions = {}
Optional runtime construction options.
Returns
Section titled “Returns”Runtime containing tracer, agent manager, and shutdown function.