The JavaScript API is this:
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition
So you could include a .js file (using includeScript(), for example) with the following:
navigator.geolocation.watchPosition(function(pos) {
Shiny.onInputChange("userPosition", {
latitude: pos.coords.latitude,
longitude: pos.coords.longitude,
altitude: pos.coords.altitude,
accuracy: pos.coords.accuracy // in meters
altitudeAccuracy: pos.coords.altitudeAccuracy // in meters,
heading: pos.coords.heading,
speed: pos.coords.speed
});
}, null, {enableHighAccuracy: true});
That would let you observe input$userPosition from the server, and it should update whenever the position changes. You can then use leafletProxy to recenter the map on the new location, and/or move a marker, or whatever.