[Next.js] How can I set the sentry environment for the browser at runtime?

Hi

We are deploying our single build to multiple environments building pages dynamically using Incremental Static Regeneration. However, Sentry seems to ignore the environment variable at runtime (defined in sentry.client.config.js). My guess is, that Sentry.init(...) is only called during the build and never at runtime.

Now to my question: How can I set the sentry environment for the browser at runtime?

Any help would be greatly appreciated!

Thanks in advance and Best Regards
Michael

Anyone having any idea on how to solve this issue?