This is an example blog of how to use Gridsome and the Firestore Source plugin to create a static site:
gridsome new firestore-blog https://github.com/u12206050/gridsome-firestore-starter
.
npm install --global @gridsome/cli
gridsome create firestore-blog https://github.com/u12206050/gridsome-firestore-starter
to install default startercd firestore-blog
to open the folder- Update
gridsome.config.js
with your AdminSDK credentials file. gridsome develop
to start a local dev server athttp://localhost:8080
- Happy coding 🎉🙌
Until Firestore receives support for handling custom service accounts, the only way is to download the Firebase AdminSDK service account credentials for your project. This does give the plugin full access to your Firebase.
In order to build your site from another server, you'll also these credentials but: BE VERY CAREFUL HOW YOU TRANSPORT THEM! DO NOT PUSH THEM TO GITHUB OR ANY OTHER CODE REPOSITORY!
- Navigate to the settings/serviceaccounts/adminsdk of your firebase project.
- Make sure
Firebase Admin SDK
is selected, and click `Generate new private key`` - Download the key and save it to the root of your project.
- For the saftey of everyone included this line in your
.gitignore
file:*-firebase-adminsdk-*.json