This is a static example using sample inputs. Remix the template to run it with your own values.
Output
Read me
📖 How to do CRUD operations in your Firestore collections
Overview
This template allows you to perform the following actions on a Firestore collection:
Read Data
Create Data
Update Data
Delete Data
Prerequisites
Connecting to Your Own Firebase Project
Users can connect their Firebase projects by providing the Project ID and setting up permissions for the BuildShip Runtime Service Account
Steps to set up your own Firebase Connection:
Access BuildShip Settings
Navigate to the Settings section, found in the top-left corner of your dashboard, next to the Project Name.
Under the General tab in BuildShip Settings, you will find information about the underlying Firebase Project ID and Service Account details. Copy the Service Account details as we need this to grant access to your Firebase project.
Navigate to the IAM & Admin section from the Firebase project's GCP Console.
Click on the Grant Access button to add a new principal.
Paste the Service Account details you copied from BuildShip into the "New Principal" field.
Assign the role of Cloud Datastore User and Firebase Admin SDK Administrator Service Agent to the Service Account.
Hit the Save button to grant access to the Service Account.
This will allow BuildShip to interact with your Firebase resources.
💡Please note that GCP takes time (approx 2 to ~7 minutes or more in extreme cases) for access changes through the system. For more info refer to this documentation here(opens in a new tab).
Troubleshooting
Follow these troubleshooting steps in case you receive the following errors:
✍️ How to Use
Step 1: Add your Project ID as an environment variable.