The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > Auth > tenantId

Auth.tenantId property

The Auth instance's tenant ID.

Signature:

tenantId: string | null;

Description

This is a readable/writable property. When you set the tenant ID of an Auth instance, all future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to the specified tenant project. When set to null, users are signed in to the parent project.

Example

// Set the tenant ID on Auth instance.
auth.tenantId = 'TENANT_PROJECT_ID';

// All future sign-in request now include tenant ID.
const result = await signInWithEmailAndPassword(auth, email, password);
// result.user.tenantId should be 'TENANT_PROJECT_ID'.