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

261
Vistas
Firebase could not load the default credentials

I have an Firestore, that i used in the previous project, but now i need to use this same Firestore in another project, so I try to connect to my Firestore in it like that:

const firebaseCredentials = {
    apiKey: "some",
    authDomain: "some",
    databaseURL: "some",
    projectId: "some",
    storageBucket: "some",
    messagingSenderId: "some",
    appId: "some"
}

@Injectable()
export class FirestoreProvider {

    public db: admin.firestore.Firestore;

    constructor() {
        this.db = admin.initializeApp(firebaseCredentials).firestore();
    }
}

this provider I inject in one of my service like this:

@Injectable()
export class AppService {

  constructor(
    private readonly firestore: FirestoreProvider
  ) {}

  getHello(): any {
    const snap = this.firestore.db
      .collection("books")
      .get();

    return snap;
  }
}

and now i have a problem, when i try to run this function above, my console throw me this error:

[Nest] 22700 - 21.09.2021, 18:43:47 [ExceptionsHandler] Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information. +29285ms

can someone tell me what I'm doing wrong? in the previous project everything work fine with this same credentials, thanks for any help!

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