The Firestore Wrapper, which is built specifically for Katana, is a small, easy wrapper used to log actions to Firestore. It does nothing more.
View firestore-wrapper.js on Github
If you use this separately from Katana, which it is not built for, the structure of your database will need to match what is described in Database Structure. It also requires the firebase-admin package to properly run. To implement the wrapper in your code:
const firestoreWrapper = require('./firestore-wrapper.js'); const db = firestoreWrapper.initializeFirebase();
From there on, db can be used to access all of Firestore's API.
db
Four public functions are exposed by the wrapper's export:
--db
One private function is used internally: