Skip to main content

Firebase Component

Create, read, update, and delete documents in a Firebase Cloud Firestore database collection.

Component key: firebase

Description#

Firebase is a platform developed by Google for creating mobile and web applications. Firebase Cloud Firestore is a document-based, flexible, scalable NoSQL cloud database, used to store and sync data for client and server-side applications. This component uses the Firebase Admin SDK to create, read, update, delete, and list documents within a Firebase Cloud Firestore collection. See more information about the Cloud Firestore section of the Firebase Admin SDK in the Firebase Docs

Authorization Notes#

The Firebase Admin SDK is a set of server libraries that lets you interact with Firebase from privileged environments. To authenticate through the Firebase Admin SDK, follow the instructions to generate a private key located on the Firebase docs You will receive a JSON file containing many fields including a private key, and client email which you will use to make a private key credential. In the new credential, set the username field equal to the value of the client email, and set the private key to the private key obtained from Firebase.

Actions#

Create Document#

Create a document in a Cloud Firestore collection | key: createDocument

InputKeyNotesExample

Collection

string
/ Required
collectionProvide a string value for the collection name.Customers

Data

data
/ Required
dataProvide a key value pair that represents your data.

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

Output Example Payload#

{  "data": {    "id": "",    "path": ""  }}

Delete Document#

Remove a document from a Cloud Firestore collection | key: deleteDocument

InputKeyNotesExample

Collection

string
/ Required
collectionProvide a string value for the collection name.Customers

Document

string
/ Required
documentProvide a string value for the unique identifier of the document./path/to/destination/file.txt

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret


Get document#

Get the contents of a document in a Cloud Firestore collection | key: getDocument

InputKeyNotesExample

Collection

string
/ Required
collectionProvide a string value for the collection name.Customers

Document

string
/ Required
documentProvide a string value for the unique identifier of the document./path/to/destination/file.txt

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

Output Example Payload#

{  "data": {    "data": {},    "id": "",    "createTime": "2021-08-25T05:00:00.000Z",    "updateTime": "2021-08-25T05:00:00.000Z",    "exists": true,    "readTime": "2021-08-25T05:00:00.000Z"  }}

List Collections#

List all collections in a Cloud Firestore database | key: listCollections

InputKeyNotes

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret


List Documents#

List all documents in a Cloud Firestore collection | key: listDocuments

InputKeyNotesExample

Collection

string
/ Required
collectionProvide a string value for the collection name.Customers

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret

Output Example Payload#

{  "data": [    {      "id": "",      "path": ""    }  ]}

Update Document#

Updates a document in a Cloud Firestore collection | key: updateDocument

InputKeyNotesExample

Collection

string
/ Required
collectionProvide a string value for the collection name.Customers

Data

data
/ Required
dataProvide a key value pair that represents your data.

Document

string
/ Required
documentProvide a string value for the unique identifier of the document./path/to/destination/file.txt

Project Id

string
/ Required
projectIdProvide the value from your generated Firebase Admin credential.

Authorization#

Authorization is required for this action.
Auth TypeKeyDescriptionFields
API Key / Secretapi_key_secretAPI Key / Secret Combination

API Key |  api_key

API Secret |  api_secret