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

214
Views
¿Un script para crear un usuario de Firebase y agregar reclamos rápidamente?

Me preguntaba si alguien tenía un script a mano que pudiera tomar una ruta al archivo de configuración JSON del administrador y crear usuarios con notificaciones personalizadas.

Nunca he escrito un guión, pero adivinar algo como esto

 import FirebaseAdmin import "./config.json" //maybe gets the userID from the console? createUser() { ...create user and attach the claims }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Aquí hay un script de Node.js que creará dos usuarios y les asignará un reclamo de role . Puede agregar tantos usuarios como desee, simplemente copie/pegue y adapte el bloque const p1 y agregue la promesa p<X> al Array.

Lo ejecuta llamando al node thenameofthescriptfile.js

 #!/usr/bin/node const admin = require('firebase-admin'); admin.initializeApp({ credential: admin.credential.cert("xyz.json") }); const p1 = admin.auth() .createUser({ email: '...', password: '....', displayName: '....' }) .then((userRecord) => { return admin.auth().setCustomUserClaims(userRecord.uid, { role: "..." }) }) .catch((error) => { console.log('Error creating new user:', error); }); const p2 = admin.auth() .createUser({ email: '...', password: '....', displayName: '....' }) .then((userRecord) => { return admin.auth().setCustomUserClaims(userRecord.uid, { role: "..." }) }) .catch((error) => { console.log('Error creating new user:', error); }); Promise.all([p1, p2]);
about 4 years ago · Juan Pablo Isaza Report
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!