<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [PhoneAuthCredential](./auth-types.phoneauthcredential.md) &gt; [fromJSON](./auth-types.phoneauthcredential.fromjson.md)

## PhoneAuthCredential.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): PhoneAuthCredential | null;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  json | object \| string | Either <code>object</code> or the stringified representation of the object. When string is provided, <code>JSON.parse</code> would be called first. |

<b>Returns:</b>

[PhoneAuthCredential](./auth-types.phoneauthcredential.md) \| null

If the JSON input does not represent an [AuthCredential](./auth-types.authcredential.md)<!-- -->, null is returned.

