triplecheck-repository-firestore
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    triplecheck-repository-firestore

    TripleCheck database repository

    TripleCheck: Firestore database repository

    Database utility for using Firestore with TripleCheck broker. It implements the repository base at triplecheck-core.

    Instructions

    In your triplecheck-broker implementation, do a regular import for triplecheck-repository-firestore and pass the repository to the broker. A basic implementation could look like:

    import { FirestoreRepository } from 'triplecheck-repository-firestore';
    import { TripleCheckBroker } from 'triplecheck-broker';
    
    // If inside Google Cloud Platform:
    // Pass the repo your Firestore configuration and the collection name
    const repository = FirestoreRepository(undefined, "your-database-name");
    
    // If outside Google Cloud Platform:
    // Pass the repo your Firestore configuration and the collection name
    // Keyfile/config only needed when running outside of GCP context
    // @see https://cloud.google.com/firestore/docs/quickstart-servers
    const repository = FirestoreRepository({
      projectId: 'your-project-id',
      keyFilename: 'keyfile.json'
    }, "your-database-name");
    
    const request = "Get this from your API request and transform it as needed";
    const payload = "Body";
    
    const { responseData, status, headers } = await TripleCheckBroker(
      request,
      payload,
      repository
    );

    Install

    npm i triplecheck-repository-firestore

    DownloadsWeekly Downloads

    5

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    742 kB

    Total Files

    36

    Last publish

    Collaborators

    • avatar