Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda