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

244
Vistas
Firebase creating custom token using spotify signin?

I am trying to implement a 'Log in with Spotify' feature for my react app. I am trying to follow this blog but I am not able use

firebase.auth().createCustomToken(uid)

as i get the error

.createCustomToken is not a function

I also tried using firebase-admin package but I run into

Can't resolve util in /node_modules/@google_cloud/common/build/src

This is what I have tried to do so far. I have never used firebase before. Any help would be appreciated.

 import {getAuth} from 'firebase-admin/auth';
 import { initializeApp } from 'firebase-admin/app';
 import admin from 'firebase-admin';

var serviceAccount = require('./service-account.json')
const spotifyApi = new SpotifyWebApi();
admin.initializeApp({
  credential: admin.credential.cert(serviceAccount)
})
let uid= 5;

getAuth().createCustomToken(uid).then(function(customToken) {
  console.log(customToken);
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The blog post you're following is a few years old, and recent versions of the Firebase SDK for JavaScript have switched to a different syntax (to allow build tools to automatically exclude unused parts of the SDK from you app bundle).

What used to be:

firebase.auth().createCustomToken(uid)...

Is now accomplished with:

createCustomToken(getAuth(), uid)...

For more on this, I recommend also checking out the upgrade guide for the new v9 SDK.


Update: as Dharmaraj commented below createCustomToken is still a method on the auth object.

about 4 years ago · Juan Pablo Isaza Denunciar
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