I'm quite new with firebase and I have tried to setup a simple login app using the Authentication service.
I have followed the official get started and I have noticed that the flutterfire configure
command add a new file in my project: firebase_options.dart
.
This is a plain text file with a bunch of configuration keys for each platform:
...
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'xxxxx',
appId: '1:xxxx:android:xxxx',
messagingSenderId: 'xxxx',
projectId: 'xxxx-app',
storageBucket: 'xxxxx.appspot.com',
);
...
My question is, is it safe to store in a repository? Should I use something else like .env
?
Beside of this, my second question is about how my app should comunicate with firebase.
All the users use the main key to query the db? Shouldn't each user have his own key?
Usually when I build web app with APIs each user has his own api_key and I use it to query a service, in this case I do not understand if am I missing something or this is the expected behavior.