Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
How to create a unique identifier for a Vue JS 2 App

I'm wondering if there is a nice way to have a UUID for a Vue JS 2 App.

I'm currently developing a Laravel API that is consumed by Android/IOS devices that identifies themselves by using the installation_id. Since it only changes on new app installation, it seems like the best approach for this purpose.

Now I have to develop the Vue JS app, but of course, there is no such thing. I've found this package but unfortunately, it only supports Vue JS 3: https://github.com/VitorLuizC/vue-uuid

Basically, what I need is to have uuid per app instance which persist on page refresh and even of hard refresh (not sure if possible at all) meaning clearing the app data from localStorage.

So far, I can only imagine creating a random uuid using this and storing it on localStorage, then on app mount check if this uuid exists on localStorage and if not, store it, otherwise just continue on.

import { v4 as uuidv4 } from 'uuid'
...
new Vue({
    router,
    mounted () {
        if (!localStorage.getItem('installation_id')) {
            localStorage.setItem('installation_id', uuidv4())
        }
    }
    render: h => h(App)
}).$mount('#app')

I will appreciate any help to get the right path to achieve this.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!