- Call userID to identify your users when recording a session. The identity of the user can be changed, but OpenReplay will only keep the last communicated user ID.
+ Call setUserID to identify your users when recording a session. The identity of the user can be changed, but OpenReplay will only keep the last communicated user ID.
-
+
@@ -38,8 +38,8 @@ export default function IdentifyUsersTab() {
Inject metadata when recording sessions
-
Use the metadata method in your code to inject custom user data in the form of a key/value pair (string).
-
+
Use the setMetadata method in your code to inject custom user data in the form of a key/value pair (string).
+
diff --git a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js
index 09e5fd4c9..bd2cb7d21 100644
--- a/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js
+++ b/frontend/app/components/Onboarding/components/OnboardingTabs/InstallDocs/InstallDocs.js
@@ -6,26 +6,33 @@ import Highlight from 'react-highlight'
import CircleNumber from '../../CircleNumber'
import { Slider, CopyButton } from 'UI'
-const installationCommand = 'npm i @openreplay/tracker --save'
+const installationCommand = 'npm i @openreplay/tracker'
const usageCode = `import Tracker from '@openreplay/tracker';
+
const tracker = new Tracker({
- projectID: PROJECT_ID
+ projectKey: "PROJECT_KEY",
+ ingestPoint: "https://${window.location.hostname}/ingest",
});
tracker.start();`
const usageCodeSST = `import Tracker from '@openreplay/tracker/cjs';
-//...
+
const tracker = new Tracker({
- projectID: PROJECT_ID,
- onStart: () => { tracker.userID('MY_USER_ID'); },
+ projectKey: "PROJECT_KEY",
+ ingestPoint: "https://${window.location.hostname}/ingest",
});
-//...
- useEffect(() => { // or componentDidMount
+
+function MyApp() {
+ useEffect(() => { // use componentDidMount in case of React Class Component
tracker.start();
- }, [])`
+ }, []);
+
+ //...
+}`
+
function InstallDocs({ site }) {
- const _usageCode = usageCode.replace('PROJECT_ID', site.projectKey)
- const _usageCodeSST = usageCodeSST.replace('PROJECT_ID', site.projectKey)
+ const _usageCode = usageCode.replace('PROJECT_KEY', site.projectKey)
+ const _usageCodeSST = usageCodeSST.replace('PROJECT_KEY', site.projectKey)
const [isSpa, setIsSpa] = useState(true)
return (