UNPKG

veritatisdoloremque

Version:
52 lines (32 loc) 1.39 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [EmailAuthProvider](./auth-types.emailauthprovider.md) &gt; [credentialWithLink](./auth-types.emailauthprovider.credentialwithlink.md) ## EmailAuthProvider.credentialWithLink() method 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; ``` ## Parameters | 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> [AuthCredential](./auth-types.authcredential.md) - The auth provider credential. ## Example 1 ```javascript const authCredential = EmailAuthProvider.credentialWithLink(auth, email, emailLink); const userCredential = await signInWithCredential(auth, authCredential); ``` ## Example 2 ```javascript await sendSignInLinkToEmail(auth, email); // Obtain emailLink from user. const userCredential = await signInWithEmailLink(auth, email, emailLink); ```