#
LogRocketInstrumentationClient
A lightweight client providing access to LogRocket instrumentation utilities.
#
Methods
createWorkleapPlatformDefaultUserTraits(identification)
: Creates an object containing the default user traits used to identify a web user for the Workleap platform.registerGetSessionUrlListener(listener)
: Registers a listener that receives the session replay URL as a parameter once it becomes available. Host applications should use LogRocket.getSessionURL instead of this method.
#
Usage
#
Get default user traits for the Workleap platform
import { useLogRocketInstrumentationClient } from "@workleap/telemetry/react";
import LogRocket from "logrocket";
const client = useLogRocketInstrumentationClient();
const traits = client.createWorkleapPlatformDefaultUserTraits({
userId: "6a5e6b06-0cac-44ee-8d2b-00b9419e7da9",
organizationId: "e6bb30f8-0a00-4928-8943-1630895a3f14",
organizationName: "Acme",
isMigratedToWorkleap: true,
isOrganizationCreator: false,
isAdmin: false
});
Logrocket.identify(traits.userId, traits);
#
Parameters
identification
: An object that uniquely identifies the current user and provide additional context about the user environment.userId
: A value that uniquely identifies the current user.organizationId
: The organization's unique id.organizationName
: The organization name.isMigratedToWorkleap
: Whether or not this user's organization has been migrated to use the WLP, or if the user has signed up to the new experience directly.isAdmin
: Whether or not the user is an administrator in the current workspace.isOrganizationCreator
: An optional value indicating whether or not the user originally signed up to create the workspace.isReportingManager
: An optional value indicating whether or not the user is a reporting manager in the current workspace.isTeamManager
: An optional value indicating whether or not the user is a team manager in the current workspace.isExecutive
: An optional object includingboolean
values indicating whether or not the user is an executive for specific product:wov
: An optional value indicating whether or not the user is an Officevibe executive.lms
: An optional value indicating whether or not the user is an LMS executive.onb
: An optional value indicating whether or not the user is an Onboarding executive.sks
: An optional value indicating whether or not the user is a Skills executive.wpm
: An optional value indicating whether or not the user is a Performance executive.pbd
: An optional value indicating whether or not the user is a Pingboard executive.cmp
: An optional value indicating whether or not the user is a Compensation executive.
isCollaborator
: An optional object includingboolean
values indicating whether or not the user is a collaborator for specific product:wov
: An optional value indicating whether or not the user is an Officevibe collaborator.lms
: An optional value indicating whether or not the user is an LMS collaborator.onb
: An optional value indicating whether or not the user is an Onboarding collaborator.sks
: An optional value indicating whether or not the user is a Skills collaborator.wpm
: An optional value indicating whether or not the user is a Performance collaborator.pbd
: An optional value indicating whether or not the user is a Pingboard collaborator.cmp
: An optional value indicating whether or not the user is a Compensation collaborator.
planCode
: An optional object includingstring
values indicating the user plan code for specific product:wov
: An optional value indicating the user plan code for Officevibe.lms
: An optional value indicating the user plan code for LMS.onb
: An optional value indicating the user plan code for Onboarding.sks
: An optional value indicating the user plan code for Skills.wpm
: An optional value indicating the user plan code for Performance.pbd
: An optional value indicating the user plan code for Pingboard.cmp
: An optional value indicating the user plan code for Compensation.
#
Returns
An object including the default user traits matching the provided identification values:
#
Send additional traits
You can send custom user traits to improve filtering in LogRocket. To do so, merge the default user traits with your additional traits before sending them:
import { useLogRocketInstrumentationClient } from "@workleap/telemetry/react";
import LogRocket from "logrocket";
const client = useLogRocketInstrumentationClient();
const allTraits = {
...client.createWorkleapPlatformDefaultUserTraits({
userId: "6a5e6b06-0cac-44ee-8d2b-00b9419e7da9",
organizationId: "e6bb30f8-0a00-4928-8943-1630895a3f14",
organizationName: "Acme",
isMigratedToWorkleap: true,
isOrganizationCreator: false,
isAdmin: false
}),
"Additional Trait": "Trait Value"
};
Logrocket.identify(allTraits.userId, allTraits);
Additional user trait names should align with Mixpanel property conventions. We recommend using human-readable names and appending a - {ProductName}
suffix for product-specific traits, for example: Plan Code - Officevibe
.
#
Register a session URL listener
import { useLogRocketInstrumentationClient } from "@workleap/telemetry/react";
import LogRocket from "logrocket";
const client = useLogRocketInstrumentationClient();
client.registerGetSessionUrlListener(sessionUrl => {
console.log(sessionUrl);
});