For anyone arriving late to this party, we now have dynamic routing in Next 9.
Which would allow for a url structure to be crafted like this by using the file structure, and without additional packages.
You could create a file pages/user/[id].js
With
import { useRouter } from 'next/router'
const User = () => {
const router = useRouter()
const { id } = router.query
return <p>User: {id}</p>
}
export default User