-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc Update: How to declare firestore in nodejs Typescript? #129
Comments
your app is not initialized correctly. |
@muc1 The config is optional. See here: https://firebase.google.com/docs/admin/setup#initialize-without-parameters Nevertheless, however I initialise the app, with or without config, the problem I have is that I don't know how to initialise the geofirex. |
@Kayes-Islam Yeah, is nothing related to the config, faced this same issue a couple of days ago deploying functions to firebase. The way I resolved it and works without problem is doing the require-way as is in the readme for the admin-sdk, like this in typescript: import * as admin from 'firebase-admin';
import {GeoFireClient} from "geofirex";
admin.initializeApp();
const geo: GeoFireClient = require('geofirex').init(admin); Hope it helps! 👌 |
Thanks @BrDrawolf, your answer has solved this issue for me. I still think it's an issue/improvement if we could use the typescript import without having to require(). I'll leave the issue open for this. |
The readme says:
But where is firebase coming from? I have:
When I do:
const geo = geofirex.init(app);
I get:
How do I init geofirex in typescript for nodejs?
The text was updated successfully, but these errors were encountered: