Defines the tenant manager used to help manage tenant related operations. This includes:

  • The ability to create, update, list, get and delete tenants for the underlying project.
  • Getting a `TenantAwareAuth` instance for running Auth related operations (user management, provider configuration management, token verification, email link generation, etc) in the context of a specified tenant.

Index

Methods

authForTenant

  • Parameters

    • tenantId: string

      The tenant ID whose TenantAwareAuth instance is to be returned.

    Returns TenantAwareAuth

    The TenantAwareAuth instance corresponding to this tenant identifier.

createTenant

  • Creates a new tenant. When creating new tenants, tenants that use separate billing and quota will require their own project and must be defined as full_service.

    Parameters

    • tenantOptions: CreateTenantRequest

      The properties to set on the new tenant configuration to be created.

    Returns Promise<Tenant>

    A promise fulfilled with the tenant configuration corresponding to the newly created tenant.

deleteTenant

  • deleteTenant(tenantId: string): Promise<void>
  • Deletes an existing tenant.

    Parameters

    • tenantId: string

      The tenantId corresponding to the tenant to delete.

    Returns Promise<void>

    An empty promise fulfilled once the tenant has been deleted.

getTenant

  • getTenant(tenantId: string): Promise<Tenant>
  • Gets the tenant configuration for the tenant corresponding to a given tenantId.

    Parameters

    • tenantId: string

      The tenant identifier corresponding to the tenant whose data to fetch.

    Returns Promise<Tenant>

    A promise fulfilled with the tenant configuration to the provided tenantId.

listTenants

  • Retrieves a list of tenants (single batch only) with a size of maxResults starting from the offset as specified by pageToken. This is used to retrieve all the tenants of a specified project in batches.

    Parameters

    • Optional maxResults: number

      The page size, 1000 if undefined. This is also the maximum allowed limit.

    • Optional pageToken: string

      The next page token. If not specified, returns tenants starting without any offset.

    Returns Promise<ListTenantsResult>

    A promise that resolves with a batch of downloaded tenants and the next page token.

updateTenant

  • Updates an existing tenant configuration.

    Parameters

    • tenantId: string

      The tenantId corresponding to the tenant to delete.

    • tenantOptions: UpdateTenantRequest

      The properties to update on the provided tenant.

    Returns Promise<Tenant>

    A promise fulfilled with the update tenant data.