Back to Firebase Js Sdk

UserCredential interface

docs-devsite/auth.usercredential.md

12.12.12.0 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

UserCredential interface

A structure containing a User<!-- -->, the OperationType<!-- -->, and the provider ID.

operationType could be OperationType<!-- -->.SIGN_IN for a sign-in operation, OperationType<!-- -->.LINK for a linking operation and OperationType<!-- -->.REAUTHENTICATE for a reauthentication operation.

<b>Signature:</b>

typescript
export interface UserCredential 

Properties

PropertyTypeDescription
operationType(typeof OperationTypeMap<!-- -->)[keyof typeof OperationTypeMap<!-- -->]The type of operation which was used to authenticate the user (such as sign-in or link).
providerIdstring | nullThe provider which was used to authenticate the user.
userUserThe user authenticated by this credential.

UserCredential.operationType

The type of operation which was used to authenticate the user (such as sign-in or link).

<b>Signature:</b>

typescript
operationType: (typeof OperationTypeMap)[keyof typeof OperationTypeMap];

UserCredential.providerId

The provider which was used to authenticate the user.

<b>Signature:</b>

typescript
providerId: string | null;

UserCredential.user

The user authenticated by this credential.

<b>Signature:</b>

typescript
user: User;