I have problem with firestore db call with api key in my nuxt app.
If I work with default security rules its fine. But when i use google's recommended rules :
allow read, write: if request.auth.uid != null;
I got this error.
Error getting documents: FirebaseError: "Missing or insufficient permissions."
FirestoreError index.cjs.js:352 fromRpcStatus index.cjs.js:5844 fromWatchChange index.cjs.js:6341 onMessage index.cjs.js:14912 startStream index.cjs.js:14841 getCloseGuardedDispatcher index.cjs.js:14881 newTail index.cjs.js:7636
My firestore configuration file, information and API key are corrects on my file config. I'm working with API key in project => global setting => apikey :
import firebase from 'firebase'
var config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
if (!firebase.apps.length) {
firebase.initializeApp(config)
}
export const db = firebase.firestore();
export default firebase