Langfuse JS/TS SDKs
    Preparing search index...

    Type Alias LangfuseConfig

    Configuration options for Langfuse OpenAI tracing.

    This interface defines all available options for customizing how OpenAI SDK calls are traced and stored in Langfuse. It includes both trace-level metadata and generation-specific configuration.

    type LangfuseConfig = {
        generationMetadata?: Record<string, unknown>;
        generationName?: string;
        langfusePrompt?: { isFallback: boolean; name: string; version: number };
        parentSpanContext?: SpanContext;
        sessionId?: string;
        tags?: string[];
        traceName?: string;
        userId?: string;
    }
    Index

    Properties

    generationMetadata?: Record<string, unknown>

    Additional metadata to attach to the generation

    generationName?: string

    Custom name for the generation observation (defaults to SDK method name)

    langfusePrompt?: { isFallback: boolean; name: string; version: number }

    Information about the Langfuse prompt used for this generation

    Type declaration

    • isFallback: boolean

      Whether this is a fallback prompt due to retrieval failure

    • name: string

      Name of the prompt template in Langfuse

    • version: number

      Version number of the prompt template

    parentSpanContext?: SpanContext

    OpenTelemetry span context to use as parent for the generated span

    sessionId?: string

    Session identifier to group related interactions

    tags?: string[]

    Tags for categorizing and filtering traces

    traceName?: string

    Name for the trace that will contain this generation

    userId?: string

    User identifier for associating the trace with a specific user