Langfuse JS/TS SDKs
    Preparing search index...

    Type Alias MaskFunction

    MaskFunction: (params: { data: any }) => any | Promise<any>

    Function type for masking sensitive data in spans before export.

    Type declaration

      • (params: { data: any }): any | Promise<any>
      • Parameters

        • params: { data: any }

          Object containing the data to be masked

          • data: any

            The data that should be masked

        Returns any | Promise<any>

        The masked data, or a promise resolving to it

    const maskFunction: MaskFunction = async ({ data }) => {
    if (typeof data === 'string') {
    return data.replace(/password=\w+/g, 'password=***');
    }
    return data;
    };