LogRocket
LogRocket records session replay, frontend errors, network activity, console logs, and user behavior so product and engineering teams can debug production sessions. c15t loads LogRocket.min.js with crossorigin="anonymous" and then calls window.LogRocket.init('org-slug/app-slug').
Integrate with c15t
import { type ReactNode } from 'react';
import { ConsentManagerProvider } from '@c15t/react';
import { logRocket } from '@c15t/scripts/logrocket';
const scripts = [
logRocket({
appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
initOptions: {
dom: {
inputSanitizer: true,
},
},
}),
];
export function ConsentProvider({ children }: { children: ReactNode }) {
return (
<ConsentManagerProvider
options={{
mode: 'hosted',
backendURL: 'https://your-instance.c15t.dev',
scripts,
}}
>
{children}
</ConsentManagerProvider>
);
}How c15t loads it
- Category:
measurement(Analytics) - Loads when: measurement consent is granted
- On revocation: unloaded - c15t removes the script element from the DOM. LogRocket does not document a web SDK consent opt-out or stop-recording API equivalent to Clarity or Mixpanel consent methods, and removing the loader does not stop an already-initialized recorder in the current page view. Revocation fully takes effect on the next page load.
The helper maps the script-tag snippet into the manifest engine:
logRocket({
appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
})It loads https://cdn.logrocket.io/LogRocket.min.js with crossorigin="anonymous" and calls:
window.LogRocket?.init('YOUR_ORG_SLUG/YOUR_APP_SLUG', initOptions)after the script load event. appId is required and must be in org/app format.
Privacy and sanitization
LogRocket captures user behavior for replay, so configure sanitization before deploying it. LogRocket documents DOM redaction with data-private, automatic text/input/image sanitization, and network request/response sanitizers. Password fields are never recorded, but other sensitive inputs, DOM nodes, network payloads, Redux state, and Redux actions should be explicitly excluded.
Pass JSON-serializable LogRocket init options as initOptions:
logRocket({
appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
initOptions: {
dom: {
inputSanitizer: true,
textSanitizer: true,
imageSanitizer: true,
privateClassNameBlocklist: ['private-profile'],
privateAttributeBlocklist: ['data-hide-from-replay'],
},
},
})Only pass values that can safely cross the manifest boundary. Avoid functions, class instances, prototypes, Map, Set, or other non-JSON types unless you are constructing a manual Script outside the manifest helper. LogRocket also supports function-based network sanitizers; use a manual Script if you need those callbacks.
To proxy or self-host the loader, pass a custom URL. LogRocket's proxy setup also chain-loads a logger bundle, so set asyncScriptUrl as well — otherwise the async bundle is still fetched from LogRocket's CDN:
logRocket({
appId: 'YOUR_ORG_SLUG/YOUR_APP_SLUG',
scriptUrl: 'https://analytics.example.com/LogRocket.min.js',
asyncScriptUrl: 'https://analytics.example.com/logger.min.js',
})Types
LogRocketOptions
Warning: ExtractedTypeTable: Could not extract "LogRocketOptions" from "./packages/scripts/src/vendors/analytics/logrocket.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.
Script
Warning: ExtractedTypeTable: Could not extract "Script" from "./packages/core/src/libs/script-loader/types.ts" using base path "/vercel/path0/apps/c15t-docs/.leadtype/c15t". Verify the path/name and that the file is included by your tsconfig.