<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [PhoneAuthCredential](./auth.phoneauthcredential.md) &gt; [fromJSON](./auth.phoneauthcredential.fromjson.md)

## PhoneAuthCredential.fromJSON() method

Generates a phone credential based on a plain object or a JSON string.

<b>Signature:</b>

```typescript
static fromJSON(json: object | string): PhoneAuthCredential | null;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  json | object \| string |  |

<b>Returns:</b>

[PhoneAuthCredential](./auth.phoneauthcredential.md) \| null

