Skip to content

Commit c7198a9

Browse files
docs: add platform configuration
1 parent e6c4b95 commit c7198a9

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

README.md

+36-5
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ Pre-lit Firebase authentication. It provides a set of convenient utilities and w
2828

2929
See the [example](example/) project to get up and running fast.
3030

31-
## Usage
32-
The two most important widgets are
33-
- `LitAuthInit` - which initializes the package and exposes the services that will be used in your application.
34-
- `LitAuth` - which renders the UI (forms, buttons and dialogs).
31+
## Platform Configuration
3532

3633
### Android integration
3734

@@ -65,12 +62,46 @@ Otherwise you will not be able to authenticate.
6562

6663
### Web integration
6764

68-
In addition to the `firebase_auth` dependency, you'll need to modify the `web/index.html` of your app following the Firebase setup instructions:
65+
You'll need to modify the `web/index.html` of your app following the Firebase setup instructions:
6966

7067
* [Add Firebase to your JavaScript project](https://firebase.google.com/docs/web/setup#from-the-cdn).
7168

7269
Read more in the [`firebase_auth_web` README](https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_auth/firebase_auth_web/README.md).
7370

71+
Below is an example of a Flutter Web `index.html` with Firebase Auth enabled:
72+
73+
```html
74+
...
75+
<body>
76+
77+
<!-- GOOGLE SignIn Client ID -->
78+
<meta name="google-signin-client_id" content="ADD-YOUR-CLIENT-ID.apps.googleusercontent.com">
79+
80+
<!-- The core Firebase JS SDK is always required and must be listed first -->
81+
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-app.js"></script>
82+
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-auth.js"></script>
83+
84+
<!-- TODO: Add SDKs for Firebase products that you want to use
85+
https://firebase.google.com/docs/web/setup#available-libraries -->
86+
87+
<script>
88+
// Your web app's Firebase configuration
89+
var firebaseConfig = {
90+
...// ADD CONFIG HERE
91+
};
92+
// Initialize Firebase
93+
firebase.initializeApp(firebaseConfig);
94+
</script>
95+
96+
<!-- CONTINUE TO INITIALIZE FLUTTER WEB -->
97+
...
98+
```
99+
100+
## Usage
101+
The two most important widgets are
102+
- `LitAuthInit` - which initializes the package and exposes the services that will be used in your application.
103+
- `LitAuth` - which renders the UI (forms, buttons and dialogs).
104+
74105
### Lit Firebase Initialization
75106
First, you need to initialize the package with `LitAuthInit`. This should be at the root of your application. Above `MaterialApp`/`CupertinoApp`, and above any widgets that want to access authentication functionality.
76107

0 commit comments

Comments
 (0)