Skip to content

SDK doesn't honor FIREBASE_STORAGE_EMULATOR_HOST environment variable #520

@abhis3

Description

@abhis3

Go Version: 1.19.2
Emulator Version: 11.16.0

Describe the problem

The GO Admin SDK doesn't honor the env var set through FIREBASE_STORAGE_EMULATOR_HOST. You can see in this code sample that we need to set STORAGE_EMULATOR_HOST as well for this to work, or else the code will still try and point to prod.

You can see that there is some logic in the Node Admin SDK to handle this case: https://github.com/firebase/firebase-admin-node/blob/f596f2ca0d624990b93c1164a83b056ac064d38d/src/storage/storage.ts#L48

Other users are running into this issue, see https://stackoverflow.com/questions/71561446/firebase-storage-emulator-ignored-by-go-admin-sdk

Relevant Code:

https://github.com/abhis3/firebase-go-admin-sdk-mvp/blob/main/hello.go#L35

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions