All Collections
FAQ
Why do I receive errors when using the Flamelink SDK for Cloud Firestore (CFS)?
Why do I receive errors when using the Flamelink SDK for Cloud Firestore (CFS)?
Support avatar
Written by Support
Updated over a week ago

The current Flamelink JavaScript SDK was developed specifically for the Realtime Database and does not support CFS at the moment.

When are you aiming to support Cloud Firestore?

We are currently aiming to release big changes in 2019 to the SDK which would then include support for CFS.

You have 2 options at this stage: While we're working on implementing support for Firestore within our flamelink JavaScript SDK

  1. Switch to using the Realtime DB with Flamelink

  2. Use the firebase SDK directly instead of our flamelink SDK

If you decide to go with Option 2, it is relatively easy to get this content out of Firestore. It will most likely look something like this:

import firebase from 'firebase/app'
import 'firebase/firestore'
// import other services you use

const config = {
  apiKey: "<API_KEY>",
  authDomain: "<PROJECT_ID>.firebaseapp.com",
  databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
  storageBucket: "<BUCKET>.appspot.com",
};

firebase.initializeApp(config);
const db = firebase.firestore();

db
  .collection('fl_content')
  .where('_fl_meta_.schema', '==', 'blog')
  .get()
  .then((querySnapshot) => {
    querySnapshot.forEach((doc) => {
        console.log(`${doc.id} => ${doc.data()}`);
    });
  })
  .catch(function(error) {
      console.log("Error getting documents: ", error);
  });

Since Flamelink stores all of the content in the Firestore DB, you can use the Firebase SDK to query your content. Our JavaScript SDK is a wrapper around the Firebase SDK that removes all of the "ugliness" for you.

Did this answer your question?