voluptasmollitia
Version:
Monorepo for the Firebase JavaScript SDK
47 lines (27 loc) • 1.25 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[](./index.md) > [@firebase/auth](./auth.md) > [EmailAuthProvider](./auth.emailauthprovider.md) > [credentialWithLink](./auth.emailauthprovider.credentialwithlink.md)
Initialize an [AuthCredential](./auth.authcredential.md) using an email and an email link after a sign in with email link operation.
<b>Signature:</b>
```typescript
static credentialWithLink(email: string, emailLink: string): EmailAuthCredential;
```
| Parameter | Type | Description |
| --- | --- | --- |
| email | string | Email address. |
| emailLink | string | Sign-in email link. |
<b>Returns:</b>
[](./auth.emailauthcredential.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);
```