Open Ticlext-Altihaf opened 11 months ago
Yes, you can read about it here:
https://firebase-php.readthedocs.io/en/stable/testing.html#using-the-firebase-emulator-suite
Uh.. I think you misunderstood me, I did read the docs I can't find the guide where I can use Firebase Demo Project, yes it work with Real Firebase Project.
The code, where in Node.js SDK it work without credentials.
$request = CreateUser::new()
->withEmail($email)
->withPhoneNumber($phoneNumber)
->withClearTextPassword($password)
->withDisplayName($faker->name);
$firebaseUser = Firebase::auth()->createUser($request);
Ah, I understand now, sorry for closing the issue so early 🙏🏻 (it's early here 😅)
I think this should be working, I'm running emulator tests with it, but seeing the demo-
prefix... I've perhaps been doing it wrong the whole time 😬
I'll try to look into it as soon as I find the time, I'm currently working on the next major release for PHP 8.3, and I do have only limited time...
@jeromegamez Did you ever find a solution for this? I am running into a similar issue where verifyIdToken() is making calls to google apis even though I'm pointing to the Firebase Emulators.
Offline fails with curl error - Next Kreait\Firebase\Exception\Database\ApiConnectionFailed: Unable to connect to the API: cURL error 6: Could not resolve host: oauth2.googleapis.com (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://oauth2.googleapis.com/token in ...vendor/kreait/firebase-php/src/Firebase/Exception/DatabaseApiExceptionConverter.php:37
Describe the feature you would like to see
Is it possible to use Firebase Emulator with demo Firebase project, it would be useful for CI testing where the current setup require creating new Firebase project and issue service account.
https://firebase.google.com/docs/emulator-suite/connect_auth#choose_a_firebase_project
Example from using official Admin SDK for Node.js, it works without requiring internet connection or having Firebase project.
firebase emulators:start --project=demo-project