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

290
Views
createUser doesn't work on Firebase/Auth + Next.js

I'm working on email + password authentication on Firebase Auth + Next js. But I would like to use a dedicated uid for authentication this time. So I think I should use createUser better than createUserWithEmailAndPassword. However, the error occurs like below:

Property 'createUser' does not exist on type 'Auth'.

import { getAuth, createUserWithEmailAndPassword } from 'firebase/auth'

      const auth = getAuth()
      const newId = XXXXXXXXXXXXXx 
     
      getAuth()
      .createUser({
        uid: newId,
        email: data.email,
        password: data.password,
      })
      .then((userRecord) => {
        // See the UserRecord reference doc for the contents of userRecord.
        console.log('Successfully created new user:', userRecord.uid);
      })
      .catch((error) => {
        console.log('Error creating new user:', error);
      });

      // It works
      createUserWithEmailAndPassword(auth, data.email, data.password)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

To createUser you need to use firebase-admin SDK.

With node.js, install it with npm install firebase-admin. Then:

const admin = require("firebase-admin");
const newId = XXXXXXXXXXXXXx;

admin.auth().createUser({
  uid: newId,
  email: data.email,
  password: data.password,
})
.then(function(userRecord) {
  // See the UserRecord reference doc for the contents of userRecord.
  console.log("Successfully created new user:", userRecord.uid);
})
.catch(function(error) {
  console.log("Error creating new user:", error);
});

See Admin SKD user reference for more.

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!