We would like to route users from some custom ui elements and macros to space page.
Theres router that we can use for that, but some information is missing. The space page has following path: /spaces/:spaceKey/apps/:appId/:forgeEnvId/:route
appId is known, but where do we get forgeEnvId ?
Have tried to look for the data from different contexts but have not succeeded.
Hi there, sorry for the late reply. The environment ID is a unique ID that corresponds to a Forge app environment — (development, staging, production) and is stable for that environment.
Hey @margus.nael, sorry about the late reply! You can hardcode paths for your own app since it will be stable. I’ve forwarded some feedback to see if we can replace this key with something that’s a bit easier to get.
A more flexible workaround recommended elsewhere already is to use Forge environment variables so that you only need to set the variable once per environment and can easily update it at any time w/o code changes. For example, we build and deploy our apps via a bot user for CI/CD, and every team member registers the app anew for isolated development.
@sopel Are the env variables persistent enough? In staging and dev yeah that would be our approach also, but how does env variables work at all in forge “sandboxes”. Since we really do not know how the forge environments are built and how the environment around our app can actually change I still would go with some hardcoded strings.
Thus are you sure that the environments are built so that your env variables are consistently carried on to new one. Sry for my scepticism but its just life that has given some painful lessons and not everything is still available if we’re talking about forge and the technical solution+docs.