@@ -44,8 +44,8 @@ You just need to include the following script and CSS file in the `<head>` tag
4444of your page, below the initialization snippet from the Firebase Console:
4545
4646``` html
47- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
48- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
47+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
48+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
4949```
5050
5151### npm Module
@@ -92,13 +92,14 @@ the files within `bower_components/`:
9292FirebaseUI includes the following flows:
9393
94941 . Interaction with Identity Providers such as Google and Facebook
95- 2 . Sign-up and sign-in with email accounts
96- 3 . Password reset
97- 4 . Prevention of account duplication (activated when
95+ 2 . Phone number based authentication
96+ 3 . Sign-up and sign-in with email accounts
97+ 4 . Password reset
98+ 5 . Prevention of account duplication (activated when
9899* "One account per email address"* setting is enabled in the
99100[ Firebase console] ( https://console.firebase.google.com ) . This setting is enabled
100101by default.)
101- 5 . [ Account Chooser] ( https://www.accountchooser.com/learnmore.html?lang=en ) for
102+ 6 . [ Account Chooser] ( https://www.accountchooser.com/learnmore.html?lang=en ) for
102103remembering emails
103104
104105### Configuring sign-in providers
@@ -107,6 +108,7 @@ To use FirebaseUI to authenticate users you first need to configure each
107108provider you want to use in their own developer app settings. Please read the
108109* Before you begin* section of Firebase Authentication at the following links:
109110
111+ - [ Phone number] ( https://firebase.google.com/docs/auth/web/phone-auth )
110112- [ Email and password] ( https://firebase.google.com/docs/auth/web/password-auth#before_you_begin )
111113- [ Google] ( https://firebase.google.com/docs/auth/web/google-signin#before_you_begin )
112114- [ Facebook] ( https://firebase.google.com/docs/auth/web/facebook-login#before_you_begin )
@@ -139,8 +141,8 @@ for a more in-depth example, showcasing a Single Page Application mode.
139141 * TODO(DEVELOPER): Paste the initialization snippet from:
140142 * Firebase Console > Overview > Add Firebase to your web app. *
141143 ***************************************************************************************** -->
142- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
143- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
144+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
145+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
144146 <script type =" text/javascript" >
145147 // FirebaseUI config.
146148 var uiConfig = {
@@ -151,7 +153,8 @@ for a more in-depth example, showcasing a Single Page Application mode.
151153 firebase .auth .FacebookAuthProvider .PROVIDER_ID ,
152154 firebase .auth .TwitterAuthProvider .PROVIDER_ID ,
153155 firebase .auth .GithubAuthProvider .PROVIDER_ID ,
154- firebase .auth .EmailAuthProvider .PROVIDER_ID
156+ firebase .auth .EmailAuthProvider .PROVIDER_ID ,
157+ firebase .auth .PhoneAuthProvider .PROVIDER_ID
155158 ],
156159 // Terms of service url.
157160 tosUrl: ' <your-tos-url>'
@@ -194,6 +197,7 @@ Here is how you would track the Auth state across all your pages:
194197 var emailVerified = user .emailVerified ;
195198 var photoURL = user .photoURL ;
196199 var uid = user .uid ;
200+ var phoneNumber = user .phoneNumber ;
197201 var providerData = user .providerData ;
198202 user .getToken ().then (function (accessToken ) {
199203 document .getElementById (' sign-in-status' ).textContent = ' Signed in' ;
@@ -202,6 +206,7 @@ Here is how you would track the Auth state across all your pages:
202206 displayName: displayName,
203207 email: email,
204208 emailVerified: emailVerified,
209+ phoneNumber: phoneNumber,
205210 photoURL: photoURL,
206211 uid: uid,
207212 accessToken: accessToken,
@@ -355,6 +360,7 @@ specifying the value below.
355360| Twitter | ` firebase.auth.TwitterAuthProvider.PROVIDER_ID ` |
356361| Github | ` firebase.auth.GithubAuthProvider.PROVIDER_ID ` |
357362| Email and password| ` firebase.auth.EmailAuthProvider.PROVIDER_ID ` |
363+ | Phone number | ` firebase.auth.PhoneAuthProvider.PROVIDER_ID ` |
358364
359365### Custom scopes
360366
@@ -400,6 +406,29 @@ ui.start('#firebaseui-auth-container', {
400406});
401407```
402408
409+ ### Configure Phone Provider
410+
411+ The ` PhoneAuthProvider ` can be configured with custom reCAPTCHA parameters
412+ whether reCAPTCHA is visible or invisible (defaults to ` normal ` ). Refer to the
413+ [ reCAPTCHA API docs] ( https://developers.google.com/recaptcha/docs/display ) for
414+ more details. The following options are currently supported. Any other
415+ parameters will be ignored.
416+
417+ ``` javascript
418+ ui .start (' #firebaseui-auth-container' , {
419+ signInOptions = [
420+ {
421+ provider: firebase .auth .PhoneAuthProvider .PROVIDER_ID ,
422+ recaptchaParameters: {
423+ type: ' image' , // 'audio'
424+ size: ' normal' , // 'invisible' or 'compact'
425+ badge: ' bottomleft' // ' bottomright' or 'inline' applies to invisible.
426+ }
427+ }
428+ ]
429+ });
430+ ```
431+
403432### Sign In Flows
404433
405434Two sign in flows are available:
@@ -453,8 +482,8 @@ FirebaseUI is displayed.
453482 * TODO(DEVELOPER): Paste the initialization snippet from:
454483 * Firebase Console > Overview > Add Firebase to your web app. *
455484 ***************************************************************************************** -->
456- <script src =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.js" ></script >
457- <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/1 .0.1 /firebaseui.css" />
485+ <script src =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.js" ></script >
486+ <link type =" text/css" rel =" stylesheet" href =" https://cdn.firebase.com/libs/firebaseui/2 .0.0 /firebaseui.css" />
458487 <script type =" text/javascript" >
459488 // FirebaseUI config.
460489 var uiConfig = {
@@ -488,6 +517,15 @@ FirebaseUI is displayed.
488517 provider: firebase .auth .EmailAuthProvider .PROVIDER_ID ,
489518 // Whether the display name should be displayed in the Sign Up page.
490519 requireDisplayName: true
520+ },
521+ {
522+ provider: firebase .auth .PhoneAuthProvider .PROVIDER_ID ,
523+ // Invisible reCAPTCHA with image challenge and bottom left badge.
524+ recaptchaParameters: {
525+ type: ' image' ,
526+ size: ' invisible' ,
527+ badge: ' bottomleft'
528+ }
491529 }
492530 ],
493531 // Terms of service url.
0 commit comments