@launchdarkly/observability-react-native
    Preparing search index...

    Interface ReactNativeOptions

    interface ReactNativeOptions {
        backendUrl?: string;
        contextFriendlyName?: (context: LDContext) => undefined | string;
        customHeaders?: Record<string, string>;
        debug?: boolean;
        disableErrorTracking?: boolean;
        disableLogs?: boolean;
        disableMetrics?: boolean;
        disableTraces?: boolean;
        flagExposureDedupeMaxSize?: number;
        flagExposureDedupeWindowMillis?: number;
        maxBufferSize?: number;
        networkRecording?: NetworkRecordingOptions;
        otlpEndpoint?: string;
        resourceAttributes?: Attributes;
        serviceName?: string;
        serviceVersion?: string;
        sessionTimeout?: number;
        tracingOrigins?: boolean | (string | RegExp)[];
        uploadIntervalMillis?: number;
        urlBlocklist?: string[];
    }
    Index

    Properties

    backendUrl?: string

    The backend URL for the application.

    'https://pub.observability.app.launchdarkly.com'
    
    contextFriendlyName?: (context: LDContext) => undefined | string

    A function that returns a friendly name for a given context. This name will be used to identify the session in the observability UI.

    contextFriendlyName: (context: LDContext) => {
    if(context.kind === 'multi' && context.user?.email) {
    return context.user.email;
    } else if(context.kind === 'user') {
    return context.key;
    }
    // Use the default identifier for contexts which don't contain a user.
    return undefined;
    }

    Type declaration

      • (context: LDContext): undefined | string
      • Parameters

        • context: LDContext

          The context to get a friendly name for.

        Returns undefined | string

        The friendly name for the context, or undefined to use the default identifier.

    customHeaders?: Record<string, string>

    Custom headers to include with OTLP exports.

    debug?: boolean

    Debug mode - enables additional logging.

    false
    
    disableErrorTracking?: boolean

    Whether errors tracking is disabled.

    disableLogs?: boolean

    Whether logs are disabled.

    disableMetrics?: boolean

    Whether metrics are disabled.

    disableTraces?: boolean

    Disables public custom tracing APIs (startSpan, startActiveSpan, withSpan, getTracer(), track, runWithHeaders, startWithHeaders). SDK auto-instrumentation (network requests, internal telemetry) is unaffected.

    flagExposureDedupeMaxSize?: number

    The maximum number of unique feature flag exposure keys tracked for deduplication at once. When exceeded, the least recently recorded keys are evicted to bound memory usage.

    2000
    
    flagExposureDedupeWindowMillis?: number

    The time window, in milliseconds, during which repeated feature flag evaluations that resolve to the same result are deduplicated, so that only a single feature_flag exposure span is emitted per unique (flag key, value, variation, reason, context) within the window.

    This is useful for reducing exposure volume caused by frequent re-evaluations (for example, React re-renders).

    Set to 0 (the default) to disable deduplication and emit an exposure for every evaluation. Set a positive value to enable it.

    0 (disabled)
    
    maxBufferSize?: number

    The maximum number of spans and log records held in the in-memory export buffer before the oldest are dropped. Applied to both traces and logs.

    Telemetry is buffered in memory only (there is no on-disk persistence), so this value bounds how much can be retained while the device is offline or between uploads. When the buffer is full, newly recorded items are dropped until space frees up (the already-buffered items are kept and exported). Larger values retain more data across short outages at the cost of memory; anything still buffered is lost if the app is terminated.

    2048
    
    networkRecording?: NetworkRecordingOptions

    Options for recording network request and response headers and bodies, with controls for redacting sensitive data.

    otlpEndpoint?: string

    The endpoint URL for the OTLP exporter.

    'https://otel.observability.app.launchdarkly.com:4318'
    
    resourceAttributes?: Attributes

    Additional resource attributes to include in telemetry data.

    serviceName?: string

    The service name for the application.

    'react-native-app'
    
    serviceVersion?: string

    The service version for the application.

    '1.0.0'
    
    sessionTimeout?: number

    Maximum inactivity, in milliseconds, before the next app launch / JS reload starts a new session instead of continuing the previous one. Measured from the last recorded activity to the next load.

    The session id is never rotated while the app is running (in-process): it is decided once per JS load and held for that load's lifetime, mirroring the native session replay / observability instance, which treats an externally supplied id as a custom session and never auto-rotates it. Session boundaries therefore only occur at a launch/reload, governed by this value.

    15 * 60 * 1000 (15 minutes)
    
    tracingOrigins?: boolean | (string | RegExp)[]

    Specifies where the backend of the app lives. If specified, the SDK will attach tracing headers to outgoing requests whose destination URLs match a substring or regexp from this list, so that backend errors can be linked back to the session. If 'true' is specified, all requests to the current domain will be matched.

    tracingOrigins: ['localhost', /^//, 'backend.myapp.com']
    
    uploadIntervalMillis?: number

    The delay, in milliseconds, between scheduled uploads of buffered spans and log records. Applied to both traces and logs. Lower values upload more frequently in smaller batches; higher values upload less frequently in larger batches.

    5000
    
    urlBlocklist?: string[]

    URLs to not record headers and bodies for, and to not propagate trace headers (e.g. traceparent) to. Each entry is matched as a case-insensitive substring of the full request URL; a match suppresses both recording and trace-header propagation for that request.

    urlBlocklist: ['localhost', 'backend.myapp.com']