import React from 'react'; import cn from 'classnames'; import { CopyButton, CodeBlock } from 'UI'; import stl from './installDocs.module.css'; import { useTranslation } from 'react-i18next'; const installationCommand = 'npm i @openreplay/tracker'; const usageCode = `import { tracker } from '@openreplay/tracker'; tracker.configure({ projectKey: "PROJECT_KEY", ingestPoint: "https://${window.location.hostname}/ingest", }); tracker.start()`; const usageCodeSST = `import { tracker } from '@openreplay/tracker/cjs'; // alternatively you can use dynamic import without /cjs suffix to prevent issues with window scope tracker.configure({ projectKey: "PROJECT_KEY", ingestPoint: "https://${window.location.hostname}/ingest", }); function MyApp() { useEffect(() => { // use componentDidMount in case of React Class Component tracker.start() }, []); //... }`; function InstallDocs({ site }) { const { t } = useTranslation(); const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey); return (