How to fix auth/invalid-email-verified: Email verified property must be boolean in Firebase

FirebaseBEGINNERLOWUpdated Dec 22, 2025ยท 128 views

This Firebase Admin SDK error occurs when you attempt to set the emailVerified property to a non-boolean value. The emailVerified field only accepts true or false, not strings, numbers, or other types. Fix by ensuring you pass a boolean value when creating or updating users.

Quick fix

Fixes auth/invalid-email-verified: Email verified property must be boolean

// Check these patterns
admin.auth().createUser({
  email: "user@example.com",
  emailVerified: // <- check this value
});

admin.auth().updateUser(uid, {
  emailVerified: // <- check this value
});
  1. Identify where emailVerified is being set
  2. Convert string values to boolean
  3. Handle null and undefined values
  4. Validate incoming data with type guards
firebase โ€” error
// Check these patterns
admin.auth().createUser({
email: "user@example.com",
emailVerified: // <- check this value
});
admin.auth().updateUser(uid, {
emailVerified: // <- check this value
});
auth/invalid-email-verified: Email verified property must be boolean

What this error means

The "auth/invalid-email-verified" error in Firebase Admin SDK indicates that your code is trying to set the emailVerified user property to a value that is not a boolean (true or false). This error appears when using admin.auth().createUser() or admin.auth().updateUser() methods. Firebase strictly validates the emailVerified property to ensure it contains only boolean values, as this field determines whether a user has verified their email address. Passing strings like "true" or "false", numbers like 1 or 0, null, undefined, or any other non-boolean type will trigger this validation error.

Typical symptoms

  • Error code "auth/invalid-email-verified" appears when calling updateUser() or createUser()
  • Firebase Admin SDK throws validation error with message "Email verified property must be boolean"
  • User creation or update operations fail immediately at validation stage
  • Error appears in server logs or Cloud Functions execution logs
  • TypeScript compilation succeeds but runtime error occurs
  • Batch user imports fail with emailVerified validation errors

Common causes

  1. Passing string values like "true" or "false" instead of boolean true/false
  2. Passing numeric values (1, 0) instead of boolean values
  3. Setting emailVerified to null or undefined explicitly
  4. Copying emailVerified from external data sources without type conversion
  5. Using JSON.parse() results without proper type validation
  6. Destructuring user objects that contain non-boolean emailVerified values
  7. Database query results returning emailVerified as string or number

How to fix "auth/invalid-email-verified: Email verified property must be boolean"

1Identify where emailVerified is being set

Locate all code that sets the emailVerified property in Firebase Admin SDK calls. Check createUser(), updateUser(), and importUsers() methods. Example locations:

javascript
// Check these patterns
admin.auth().createUser({
  email: "user@example.com",
  emailVerified: // <- check this value
});

admin.auth().updateUser(uid, {
  emailVerified: // <- check this value
});
2Convert string values to boolean

If you are receiving "true" or "false" as strings (from API requests, database queries, or JSON), convert them to proper boolean values:

javascript
// Incorrect - string value
const emailVerified = "true"; // Wrong!

// Correct - boolean conversion
const emailVerified = userData.emailVerified === "true";
// or
const emailVerified = Boolean(userData.emailVerified);
// or
const emailVerified = userData.emailVerified === true;
3Handle null and undefined values

If emailVerified might be null or undefined, provide a default boolean value or omit the property entirely:

javascript
// Option 1: Provide default value
const userProperties = {
  email: userData.email,
  emailVerified: userData.emailVerified ?? false
};

// Option 2: Conditionally include property
const userProperties = {
  email: userData.email,
  ...(typeof userData.emailVerified === "boolean" && {
    emailVerified: userData.emailVerified
  })
};

await admin.auth().updateUser(uid, userProperties);
4Validate incoming data with type guards

Create a validation function to ensure emailVerified is always boolean before Firebase calls:

typescript
interface UserUpdateData {
  email?: string;
  emailVerified?: boolean;
}

function validateEmailVerified(value: any): boolean {
  if (typeof value === "boolean") {
    return value;
  }
  if (value === "true" || value === 1) {
    return true;
  }
  if (value === "false" || value === 0) {
    return false;
  }
  return false; // Default to false for invalid values
}

const userData: UserUpdateData = {
  email: "user@example.com",
  emailVerified: validateEmailVerified(rawData.emailVerified)
};

await admin.auth().updateUser(uid, userData);
5Fix database query type issues

If retrieving user data from a database, ensure proper type handling:

javascript
// PostgreSQL with node-postgres
const result = await db.query("SELECT email_verified FROM users WHERE id = $1", [userId]);
const emailVerified = result.rows[0].email_verified; // May be string or number

// Convert to boolean
const userUpdate = {
  emailVerified: Boolean(emailVerified)
};

// MongoDB with Mongoose
const user = await User.findById(userId);
const emailVerified = user.emailVerified === true; // Ensure boolean

await admin.auth().updateUser(uid, { emailVerified });
6Update TypeScript types for safety

Use TypeScript to enforce correct types at compile time:

typescript
interface FirebaseUserUpdate {
  email?: string;
  emailVerified?: boolean; // Explicitly type as boolean
  displayName?: string;
}

function updateFirebaseUser(
  uid: string,
  data: FirebaseUserUpdate
): Promise<admin.auth.UserRecord> {
  // TypeScript will catch non-boolean assignments
  return admin.auth().updateUser(uid, data);
}

// Usage - TypeScript error if wrong type
await updateFirebaseUser(uid, {
  emailVerified: true // OK
});

await updateFirebaseUser(uid, {
  emailVerified: "true" // TypeScript error!
});

Advanced notes

The emailVerified property is critical for Firebase Authentication security flows. When set to true, it indicates the user has confirmed ownership of their email address. Firebase uses this flag to enforce email verification requirements in security rules and conditional access controls. In production environments, consider implementing server-side validation middleware that checks all incoming user data before Firebase Admin SDK calls. For user imports from external systems, create migration scripts that explicitly convert all emailVerified values to boolean type. Be aware that some ORMs and database drivers may return boolean fields as integers (1/0) or strings ("t"/"f"), requiring explicit type coercion. When working with Cloud Functions that process HTTP requests, remember that JSON payloads always deserialize boolean-like strings as strings, not booleans, so validation is essential. The Firebase Admin SDK provides strong type checking in TypeScript, but runtime validation is still necessary for data from external sources like databases, APIs, or user input.

Frequently asked questions

What does "auth/invalid-email-verified: Email verified property must be boolean" mean?
The "auth/invalid-email-verified" error in Firebase Admin SDK indicates that your code is trying to set the emailVerified user property to a value that is not a boolean (true or false). updateUser() methods. Firebase strictly validates the emailVerified property to ensure it contains only boolean values, as this field determines whether a user has verified their email address.
How do I fix "auth/invalid-email-verified: Email verified property must be boolean"?
This Firebase Admin SDK error occurs when you attempt to set the emailVerified property to a non-boolean value. The emailVerified field only accepts true or false, not strings, numbers, or other types. Fix by ensuring you pass a boolean value when creating or updating users.
What causes "auth/invalid-email-verified: Email verified property must be boolean"?
Passing string values like "true" or "false" instead of boolean true/false Passing numeric values (1, 0) instead of boolean values Setting emailVerified to null or undefined explicitly
Is the "auth/invalid-email-verified: Email verified property must be boolean" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading