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.