Basically the first parameter of the window.hostory.replaceState() method, serves to pass some information through the history state, accessing history.state you will have the object passed in the parameter.
The replaceState method works similarly to pushState, but instead of adding the current history input it modifies it.
The basic use of this method, following the example of this site -> https://developer.mozilla.org/en-US/docs/Web/API/History_API
1 -Suppose you are on the page https://developer.mozilla.org/en-US/docs/Web/API/History_API
2 - You will add or modify the current history entry
const stateObj = { foo: "bar" };
history.pushState(stateObj, "page 2", "bar.html");
3 - When browsing to another page, for example - https://www.google.com/ and click on the arrow to return to the site Developer.mozilla.org, you will be redirected to the address entered in the third parameter of the pushState (in this case "bar.html") and accessing
history.state you will have your stateObj object.
replaceState will change the information of the current record, if we were to use replaceState and put other information it would overwrite the data of our history.pushState.
That’s what I understood by reading the https://developer.mozilla.org/en-US/docs/Web/API/History_API, hope I’ve helped