title: NextJS. How do i get canonical URL for dynamic pages?
body: <p>Before nextjs 9.4 i have been using
  next-absolute-url package which gives origin in getInitialProps.</p>
  <p>nextsJs 9.5
  since with Automatic optimisation we use getServerSideProps and getStaticProps. the package doesn't support these methods and return undefined.</p>
  <p>My Question is that if we have dynamic page lets say post/[pid].tsx using the next-seo i require canonical url for it how could i generate the with getStaticProps or getServerSideProps.</p>
  <p>There is another question asked with no response here
  <a href="https://stackoverflow.com/questions/61574405/how-to-access-canonical-url-in-next-js-with-automatic-static-optimization-turned">How to access canonical URL in Next.js with Automatic Static Optimization turned on?</a></p>