Hello Netlify Support Team & community!
I could not find documentation or write ups of this being done, but I was wondering if there was way to share or query build environment variables of other Netlify application deployments or applications in same monorepo. I’ll try to clarify below.
The reasoning: I have one Netlify application that acts as a CMS and the other a Frontend.
The CMS is able to pull in the frontend application in an SPA mode to do live previews of the content in production or any branch context deploy.
However being that the CMS UI is statically generated itself (Sanity.io) , and it needs access to the appropriate
DEPLOY_PRIME_URL in order to resolve the correct preview URL’s for the
iframe which shows the preview. From my understanding those URL build variables are dynamic is some form when using a specific context.
Is there a way I can maybe use redirects? This is first thing that comes to mind as a low cost solution, but I am not sure how I’d get access to the those same BUILD env vars for this to work.
It would be useful to get access to other build envs in order to programmatically generate deployments that can work in sync. I feel like this is possible, and I am just missing it somewhere. A build plugin?
Relevant side note: I just learned that Netlify Dev can only do local dev for one site at a time. Making it’s uses for monorepo limited and not able to solve my case here as I thought it might be able to.
Any clarity on this would be greatly helpful