# Best practices

# Privacy

Follow privacy best practices to reduce the risk of exposing Personally Identifiable Information (PII) in LogRocket session replays.

# Log relevant information

It's recommended to log as much relevant information as possible into the LogRocket session replay console. This is typically done using the LogRocketLogger class or directly through the LogRocket SDK.

At minimum, make sure to provide a LogRocketLogger instance to Workleap's libraries accepting a loggers option.

Here are some examples 👇

# Telemetry

Initialize telemetry with a LogRocketLogger instance:

import { initializeTelemetry } from "@workleap/telemetry/react";
import { LogLevel } from "@workleap/logging";
import { LogRocketLogger } from "@workleap/logrocket";

const client = initializeTelemetry({
    logRocket: {
        appId: "my-app-id"
    },
    honeycomb: {
        namespace: "sample",
        serviceName: "my-app",
        apiServiceUrls: [/.+/g],
        options: {
            proxy: "https://sample-proxy"
        }
    },
    mixpanel: {
        productId: "wlp",
        envOrTrackingApiBaseUrl: "development"
    },
    loggers: [new LogRocketLogger({ logLevel: LogLevel.information })]
});

# Common Room

Initialize Common Room with a LogRocketLogger instance:

import { registerCommonRoomInstrumentation } from "@workleap/common-room/react";
import { LogLevel } from "@workleap/logging";
import { LogRocketLogger } from "@workleap/logrocket/react";

const client = registerCommonRoomInstrumentation("my-site-id", {
    loggers: [new LogRocketLogger({ logLevel: LogLevel.information })]
});

# Squide firefly

Initialize Squide firefly with a LogRocketLogger instance:

import { initializeFirefly } from "@squide/firefly";
import { LogLevel } from "@workleap/logging";
import { LogRocketLogger } from "@workleap/logrocket/react";

const runtime = initializeFirefly({
    loggers: [new LogRocketLogger({ logLevel: LogLevel.information })]
});

# Platform widgets

Initialize platform widgets with verbose mode activated and a LogRocketLogger instance:

import { initializeWidgets } from "@workleap-widgets/client/react";
import { LogLevel } from "@workleap/logging";
import { LogRocketLogger } from "@workleap/logrocket/react";

const widgetsRuntime = initializeWidgets("wlp", "development" , {
    loggers: [new LogRocketLogger({ logLevel: LogLevel.information })]
});