0

I have three different cloud-function projects and each project contains unique function and environment variables associated with them. Is there a way to have access to environment variables setup in project 'A', while function in project 'B' is being executed?

Say functions.config().user.name="mike" is setup in project 'A' and I want to have access to that user variable when invoking function in project 'B'.

All projects are under the same firebase account but in separate projects.

M.K. Kim
  • 481
  • 1
  • 4
  • 17

1 Answers1

0

Environment variables are deployed per-function. There's no mechanism provided to allow a function to reach into another function's configuration.

If you want to share data between functions, consider simply writing that data to a database or some other cloud-based storage system that's accessible to both.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • thanks for answering my question. by using firebase-admin and service accounts of each project, I thought that I could have access to any env variables in different projects under the same account. https://stackoverflow.com/a/46023340/11015504 – M.K. Kim Feb 27 '20 at 02:03
  • You deploy multiple functions in a single project with the same variables, but they are actually each isolated from each other. – Doug Stevenson Feb 27 '20 at 02:31