Skip to content

Doc Update: How to declare firestore in nodejs Typescript? #129

Description

@Kayes-Islam

The readme says:

With Typescript:

import * as geofirex from 'geofirex';
const geo = geofirex.init(firebase);

But where is firebase coming from? I have:

import * as admin from 'firebase-admin';
import * as geofirex from 'geofirex';
const app = admin.initializeApp();
//const geo = geofirex.init(app); // causing error, see below

When I do:
const geo = geofirex.init(app);
I get:

Argument of type 'App' is not assignable to parameter of type 'typeof firebase'.
Type 'App' is missing the following properties from type 'typeof firebase': registerVersion, setLogLevel, onLog, app, and 6 more.ts(2345)

How do I init geofirex in typescript for nodejs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions