veritatisdoloremque
Version:
Monorepo for the Firebase JavaScript SDK
52 lines (32 loc) • 1.39 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[](./index.md) > [@firebase/auth-types](./auth-types.md) > [EmailAuthProvider](./auth-types.emailauthprovider.md) > [credentialWithLink](./auth-types.emailauthprovider.credentialwithlink.md)
Initialize an [AuthCredential](./auth-types.authcredential.md) using an email and an email link after a sign in with email link operation.
<b>Signature:</b>
```typescript
static credentialWithLink(
auth: Auth,
email: string,
emailLink: string
): AuthCredential;
```
| Parameter | Type | Description |
| --- | --- | --- |
| auth | [Auth](./auth-types.auth.md) | The Auth instance used to verify the link. |
| email | string | Email address. |
| emailLink | string | Sign-in email link. |
<b>Returns:</b>
[](./auth-types.authcredential.md)
- The auth provider credential.
```javascript
const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink);
const userCredential = await signInWithCredential(auth, authCredential);
```
```javascript
await sendSignInLinkToEmail(auth, email);
// Obtain emailLink from user.
const userCredential = await signInWithEmailLink(auth, email, emailLink);
```