Firefighter screenshot

Firefighter

Author Avatar Theme by Koheing
Updated: 11 Oct 2022
6 Stars

Firestore REST API wrapper library worked on sveltekit + Cloudflare Workers

Overview

The “firefightertestfirefighter” is a Firestore REST API wrapper library that is designed to work on @sveltejs/kit + Cloudflare Workers. It allows for reading and writing to Firestore using a JWT authenticated by Firebase Authentication or Google OAuth. This library was created to address the limitation of the official Firestore library, which currently cannot be used on page.js and server.js of @sveltejs/kit + Cloudflare Workers.

Features

  • getlist: Retrieve a list of data from Firestore.
  • runQuery: Execute a query on Firestore.
  • patch: Update a document in Firestore using the set, update, or delete operation.
  • createDocument: Create a new document in Firestore.
  • commit: Perform batch operations or transactions in Firestore.
  • gRPC Listen: Listen for real-time updates from Firestore (similar to onSnapshot function in the official Firestore library).

Installation

To install the “firefightertestfirefighter” library, follow these steps:

  1. Add the library as a dependency in your project:
npm install [library-name]
  1. Import the library into your code:
import { Firestore } from 'firefightertestfirefighter';
  1. Initialize the Firestore object with the JWT and fetch function:
const firestore = new Firestore(jwt, fetch);

Summary

The “firefightertestfirefighter” library is a Firestore REST API wrapper designed to be used with @sveltejs/kit + Cloudflare Workers. It provides functionality for reading and writing data to Firestore using a JWT authenticated by Firebase Authentication or Google OAuth. It offers features such as retrieving data, executing queries, updating documents, creating new documents, and performing batch operations or transactions. This library is a workaround for the limitations of the official Firestore library in the specified environment.