<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [OAuthProvider](./auth.oauthprovider.md) &gt; [credentialFromJSON](./auth.oauthprovider.credentialfromjson.md)

## OAuthProvider.credentialFromJSON() method

Creates an [OAuthCredential](./auth.oauthcredential.md) from a JSON string or a plain object.

<b>Signature:</b>

```typescript
static credentialFromJSON(json: object | string): OAuthCredential;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  json | object \| string | A plain object or a JSON string |

<b>Returns:</b>

[OAuthCredential](./auth.oauthcredential.md)

