algolia-firestore-sync
v2.0.0
Published
A helper for syncing Algolia indices with Firestore from Firebase
Downloads
121
Maintainers
Readme
algolia-firestore-sync
Simple helper for syncing indices to Firestore on Firebase
Usage
const functions = require('firebase-functions');
const algoliasearch = require('algoliasearch');
const algoliaSync = require('algolia-firestore-sync');
const algolia = algoliasearch(functions.config().algolia.appid, functions.config().algolia.adminkey);
const index = algolia.initIndex('ingredients');
exports.syncIngredients = functions.firestore.document('/<CollectionName>/{id}').onWrite(
(change, context) => {
return algoliaSync.syncAlgoliaWithFirestore(index, change, context)
}
);