veritatisdoloremque
Version:
Monorepo for the Firebase JavaScript SDK
27 lines (15 loc) • 991 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@firebase/auth-types](./auth-types.md) > [OAuthCredential](./auth-types.oauthcredential.md) > [fromJSON](./auth-types.oauthcredential.fromjson.md)
## OAuthCredential.fromJSON() method
Static method to deserialize a JSON representation of an object into an [AuthCredential](./auth-types.authcredential.md)<!-- -->.
<b>Signature:</b>
```typescript
static fromJSON(json: object | string): OAuthCredential | null;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| json | object \| string | Input can be either Object or the stringified representation of the object. When string is provided, JSON.parse would be called first. |
<b>Returns:</b>
[OAuthCredential](./auth-types.oauthcredential.md) \| null
If the JSON input does not represent an [AuthCredential](./auth-types.authcredential.md)<!-- -->, null is returned.