# Where does the info in App.getInfo() come from?!

**URL:** <https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124>\
**Category:** Ionic Framework\
**Created:** [April 6, 2022, 9:08pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124 "2022-04-06T21:08:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![a1ben](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@a1ben](https://forum.ionicframework.com/u/a1ben)\
**Post date:** [April 6, 2022, 9:08pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124/1 "2022-04-06T21:08:46Z")

</div>

Hi.  
I’m using [Capacitor’s App.getInfo()](https://capacitorjs.com/docs/apis/app#getinfo) to show the version of my (Vue3) app

I do:

```auto
<template>
  <ion-page>
    <PageHeader title="Info"></PageHeader>
    <ion-content :fullscreen="true">
      <p class="centered">v{{version}}</p>
    </ion-content>
  </ion-page>
</template>

import { App } from '@capacitor/app';
import { IonPage, IonContent } from '@ionic/vue';
import PageHeader from "@/components/PageHeader.vue";

export default defineComponent({
  name: 'Info',
  components: {
    PageHeader,
    IonContent,
    IonPage
  },
  setup() {
    const version = ref('');
    App.getInfo().then(info => {
      version.value = info.version;
    });
  return {
      version
    }
  }
});

```

In the app {{version}} shows as “1.0”. My question is, where does that come from? (I can only find a version in package.json and that is currently 0.1.1)

Many thanks!

Using:  
Ionic 6.18.1  
node v17.4.0  
npm 9.3.1

And from package.json dependencies:  
“@capacitor/android”: “3.4.0”,  
“@capacitor/app”: “^1.1.0”,  
“@capacitor/browser”: “^1.0.7”,  
“@capacitor/core”: “^3.4.0”,  
“@capacitor/haptics”: “1.1.4”,  
“@capacitor/keyboard”: “1.2.1”,  
“@capacitor/status-bar”: “1.0.7”,  
“@capacitor/storage”: “^1.2.5”,  
“@ionic/vue”: “^6.0.0”,  
“@ionic/vue-router”: “^6.0.0”,  
“axios”: “^0.26.0”,  
“core-js”: “^3.6.5”,  
“vue”: “^3.2.21”,  
“vue-router”: “^4.0.12”,  
“vuex”: “^4.0.2”

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [April 6, 2022, 9:25pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124/2 "2022-04-06T21:25:18Z")

</div>

The source code for Android is [here](https://github.com/ionic-team/capacitor-plugins/blob/22fb04179bd13fabea6187c42ed3ffc2faa866c1/app/android/src/main/java/com/capacitorjs/plugins/app/AppPlugin.java#L82). My guess is that it is from the file `android/app/build.gradle` and `versionName` as that is the version Google pulls for the Android build.

For iOS, the versions you have to maintain are in `ios/App/App.xcodeproj/project.pbxproj` so assuming that is where it gets pulled.

```auto
MARKETING_VERSION = 0.2.0; // It is in the file twice. Both have to be changed.

```

If you are looking to get the version from your `package.json` file, you can do the following (I just had to do this 🙂) - [source](https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code).

**vue.config.js**

```javascript
// Add this line above module.exports
process.env.VUE_APP_VERSION = require('./package.json').version

```

Then within your app you just do `process.env.VUE_APP_VERSION`.

**UPDATE - 2022-04-07**  
Just noticed that the documentation [here](https://capacitorjs.com/docs/apis/app#appinfo) also states where the version is from which confirms of where I thought it was being pulled from.

> The app version. On iOS it’s the CFBundleShortVersionString. On Android it’s package’s versionName.

---

<div class="post-metadata">

**Author:** ![a1ben](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@a1ben](https://forum.ionicframework.com/u/a1ben)\
**Post date:** [April 7, 2022, 8:07pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124/3 "2022-04-07T20:07:04Z")

</div>

Many thanks! I don’t have a vue.config.js in my project for some reason… so, based on [that doc page](https://cli.vuejs.org/guide/mode-and-env.html#using-env-variables-in-client-side-code) I just set an env variable for it instead. Would like to know why I don’t have a vue.config.js - but that another question! 🙂

---

<div class="post-metadata">

**Author:** ![twestrick](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/twestrick/32/136131_2.png) [@twestrick](https://forum.ionicframework.com/u/twestrick)\
**Post date:** [April 7, 2022, 8:08pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124/4 "2022-04-07T20:08:14Z")

</div>

You should be able to just create the `vue.config.js` file in your project’s root.

---

<div class="post-metadata">

**Author:** ![a1ben](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@a1ben](https://forum.ionicframework.com/u/a1ben)\
**Post date:** [April 7, 2022, 8:15pm UTC](https://forum.ionicframework.com/t/where-does-the-info-in-app-getinfo-come-from/222124/5 "2022-04-07T20:15:35Z")

</div>

Ah yes! Just created a `vue.config.js` with that one line in it (removed my substitute env variable), rebuild and it worked directly from the package.json version. Thank you 😀
