Langfuse JS/TS SDKs
    Preparing search index...

    Interface LangfuseSpanProcessorParams

    Configuration parameters for the LangfuseSpanProcessor.

    interface LangfuseSpanProcessorParams {
        additionalHeaders?: Record<string, string>;
        baseUrl?: string;
        environment?: string;
        exporter?: SpanExporter;
        exportMode?: "immediate" | "batched";
        flushAt?: number;
        flushInterval?: number;
        mask?: MaskFunction;
        publicKey?: string;
        release?: string;
        secretKey?: string;
        shouldExportSpan?: ShouldExportSpan;
        timeout?: number;
    }
    Index

    Properties

    additionalHeaders?: Record<string, string>

    Additional HTTP headers to include with requests.

    baseUrl?: string

    Langfuse instance base URL. Can also be set via LANGFUSE_BASE_URL environment variable.

    "https://cloud.langfuse.com"
    
    environment?: string

    Environment identifier for the traces. Can also be set via LANGFUSE_TRACING_ENVIRONMENT environment variable.

    exporter?: SpanExporter

    Custom OpenTelemetry span exporter. If not provided, a default OTLP exporter will be used.

    exportMode?: "immediate" | "batched"

    Span export mode to use.

    • batched: Recommended for production environments with long-running processes. Spans are batched and exported in groups for optimal performance.
    • immediate: Recommended for short-lived environments such as serverless functions. Spans are exported immediately to prevent data loss when the process terminates / is frozen.
    "batched"
    
    flushAt?: number

    Number of spans to batch before flushing. Can also be set via LANGFUSE_FLUSH_AT environment variable.

    flushInterval?: number

    Flush interval in seconds. Can also be set via LANGFUSE_FLUSH_INTERVAL environment variable.

    Function to mask sensitive data in spans before export.

    publicKey?: string

    Langfuse public API key. Can also be set via LANGFUSE_PUBLIC_KEY environment variable.

    release?: string

    Release identifier for the traces. Can also be set via LANGFUSE_RELEASE environment variable.

    secretKey?: string

    Langfuse secret API key. Can also be set via LANGFUSE_SECRET_KEY environment variable.

    shouldExportSpan?: ShouldExportSpan

    Function to determine whether a span should be exported to Langfuse.

    timeout?: number

    Request timeout in seconds. Can also be set via LANGFUSE_TIMEOUT environment variable.

    5