
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@rxdi/firestore
Advanced tools
npm i @rxdi/firestore
import { Module } from '@rxdi/core';
import { FirebaseModule } from '@rxdi/firestore';
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
@Module({
imports: [
FirebaseModule.forRoot({
projectId: 'your-firebase-project-id',
credential: process.env.IS_NOT_LAMBDA
? admin.credential.applicationDefault()
: functions.config().firebase
}),
],
})
export class AppModule {}
GOOGLE_APPLICATION_CREDENTIALS representing your Firebase configurationMore info can be found here https://firebase.google.com/docs/admin/setup
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
{
"type": "service_account",
"project_id": "",
"private_key_id": "",
"private_key": "-----BEGIN PRIVATE KEY-----\n-----END PRIVATE KEY-----\n",
"client_email": "",
"client_id": "",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-eb9yl%40xx-xx-xx.iam.gserviceaccount.com"
}
When executing admin.credential.applicationDefault() firebase will get path from GOOGLE_APPLICATION_CREDENTIALS and try to read and load the credentials.
import { Injectable, Inject } from '@rxdi/core';
import { GenericFirebaseModel, Firestore } from '@rxdi/firestore';
interface IUserType {
id: string;
displayName: string;
email: string;
}
@Injectable()
export class UserCollection extends GenericFirebaseModel<IUserType> {
constructor(@Inject(Firestore) firestore: Firestore) {
super('users', firestore);
}
}
UserCollection inside AppModule as a provider/serviceimport { Module } from '@rxdi/core';
import { FirebaseModule } from '@rxdi/firestore';
import { ModelsModule } from '../database/models.module';
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
import { UserCollection } from './models/user';
@Module({
imports: [
FirebaseModule.forRoot({
projectId: 'your-firebase-project-id',
credential: process.env.IS_NOT_LAMBDA
? admin.credential.applicationDefault()
: functions.config().firebase
}),
],
providers: [UserCollection]
})
export class AppModule {}
import { Injectable } from '@rxdi/core';
import { UserCollection } from '../models/user';
@Injectable()
export class UserCollectionService {
constructor(
private userCollection: UserCollection
) {}
}
import { CollectionReference, Firestore } from '@google-cloud/firestore';
import { StaticMethods } from './static-mixins';
export declare class FirestoreCollection<T> extends StaticMethods {
private collection;
constructor(collectionName: string, firestore: Firestore);
getCollectionRef(): CollectionReference;
getFirestoreRef(): Firestore;
getRef(doc: string): FirebaseFirestore.DocumentReference;
create(payload: T, doc?: string): Promise<T>;
get(doc: string): Promise<T>;
delete(doc: string): Promise<FirebaseFirestore.WriteResult>;
update(doc: string, payload: T): Promise<T>;
findAll(where?: T): Promise<T[]>;
find(payload: T): Promise<T>;
build<T>(payload: T): T;
}
import { FirestoreCollection } from './mixins';
export declare class StaticMethods {
static create<T>(payload: T, doc?: string): Promise<T>;
static getCollectionRef(): FirebaseFirestore.CollectionReference;
static getFirestoreRef(): FirebaseFirestore.Firestore;
static getRef(doc: string): FirebaseFirestore.DocumentReference;
static get<T>(doc: string): Promise<T>;
static delete(doc: string): Promise<FirebaseFirestore.WriteResult>;
static update<T>(doc: string, payload: T): Promise<T>;
static findAll<T>(where?: T): Promise<T[]>;
static find<T>(payload: T): Promise<T>;
static build<T>(payload: T): T;
}
FAQs
- TypeSafe, Reactive - Firebase cloud function and AWS Lambda compatability
We found that @rxdi/firestore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.