firestore-web-wrapper
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

fireStoreWeb

an intuitive wrapper for firestore web CRUD, with a built in date_created, date_updated, and doc_id field stamp

To start :

  • set the config on the .env of your NEXT project
NEXT_PUBLIC_FIREBASE_WEB_API_KEY=
NEXT_PUBLIC_FIREBASE_WEB_AUTHDOMAIN=
NEXT_PUBLIC_FIREBASE_WEB_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_WEB_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_WEB_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_WEB_APP_ID=

To use :

docPath or colPath refer to document / collection path in string: example:

  • colPath : "col_id/doc_id/col_id"
  • docPath : "col_id/doc_id"
// for documents
FirebaseFirestore.createDoc(docPath || colPath:string, value)
// if arg is colPath: docId will be autogenerated and added to the document doc_id field
FirebaseFirestore.readDoc(docPath:string)
FirebaseFirestore.updateDoc(docPath:string, value)
FirebaseFirestore.deleteDoc(docPath:string, value)

// for collections
FirebaseFirestore.readCol(colPath:string, ...queryDef:string)
FirebaseFirestore.readColGroup(colPath:string, ...queryDef:string)

// for subscriptions
FirebaseFirestore.subscribeDoc(docPath:string, callbackFn:function)
FirebaseFirestore.subscribeCol(colPath:string, callbackFn:function, ...queryDef:string)
FirebaseFirestore.subscribeColGroup(colId:string, callbackFn:function, ...queryDef:string)

Package Sidebar

Install

npm i firestore-web-wrapper

Weekly Downloads

1

Version

2.0.4

License

MIT

Unpacked Size

22.1 kB

Total Files

10

Last publish

Collaborators

  • vikyw