Skip to content

Repository files navigation

Firebase Comments

A Gatsby source plugin to retrieve comments from Firebase for StackCheats. Please find the plugin configurations and docs below.

[:construction: Plugin Under Development]

Configure

Add the following plugin configuration in gatsby-config.js to activate the plugin

{resolve: `sc-firebase-comments`,options: {apiKey: process.env.FIREBASE_API_KEY,authDomain: process.env.FIREBASE_AUTH_DOMAIN,projectId: process.env.FIREBASE_PROJECT_ID,storageBucket: process.env.FIREBASE_STORAGE_BUCKET,messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,appId: process.env.FIREBASE_APP_ID,measurementId: process.env.FIREBASE_MEASUREMENT_ID,},}

To communicate with Firebase, the following configurations are required

apiKey API Key to communicate with the Firebase
authDomain Firebase authentication domain
projectId Firebase project ID
storageBucket Firebase storage bucket that has been configured
messagingSenderId Firebase messaging sender ID
appId Firebase application ID
measurementId Firebase measurement ID

Firebase Collection

The collection (should be) is created and named as comments with the following document structure

{
"_parentId": null,
"author": string,"slug": string,"content": string,"createdAt": timestamp
}

Usage

Following GraphQL can be used to retrieve the comments

allStackCheatsComments(filter: { slug: { eq: $slug } }) {
edges {
node {
_id_parentIdauthorcontentcreatedAt
}
}
}

License

MIT

About

A StackCheats (Gatsby) Source Plugin for Comments

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages