Search code examples
javascripthtmlweb

What is a best practice for showing the version information in a web app?


I'm devloping a web app.
What are the best practices for showing the version information in a web app?
I'm using semantic versioning, and I already have the semver e.g. 1.2.0

But I'm curious where is the best way to display it and how to manage it. I am thinking to:

  • store the version in a "version" file.
  • when starting the app, read the content from the version file, and present it in a field Version in the "About" tab.

Is this reasonable approach?
Is there any example in jsfiddle or codepen that shows how to do this?

Thanks,
Avner


Solution

  • Yes, you could follow your approach. Another way would be to read the version from your package.json file

    import {version} from './package.json';
    

    and use it in your about page.