0.0.3 • Published 9 months ago

fastify-firebase-setup v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

fastify firebase setup

this package is used to connect with firebase database and perform crud operations

install

npm i fastify-firebase-setup

Usage

create .js file and put all your firebase certificate variables in it like

export const firebaseCertJson = { type: "service_account", project_id: "", private_key_id: "", private_key: "", client_email: "", client_id: "", databaseURL: "", auth_uri: "", token_uri: "", auth_provider_x509_cert_url: "", client_x509_cert_url: "", universe_domain: "" }

after that import firebaseCertJson from the .js file whatever name you want to give

import Fastify from 'fastify' import fastifyFirebase from 'fastify-firebase-setup';

import * as firebaseCert from '../firebase';

const fastify = Fastify({ logger: { transport: { target: "pino-pretty", }, }, });

const firebasetCert = firebaseCert?.firebaseCertJson; fastify.register(fastifyFirebase, firebasetCert);