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 > OAuthCredential > fromJSON

OAuthCredential.fromJSON() method

Static method to deserialize a JSON representation of an object into an AuthCredential.

Signature:

static fromJSON(json: string | object): OAuthCredential | null;

Parameters

Parameter Type Description
json string | object Input can be either Object or the stringified representation of the object. When string is provided, JSON.parse would be called first.

Returns:

OAuthCredential | null

If the JSON input does not represent an AuthCredential, null is returned.