Dynamic runtime environment variables for static sites and SPAs (e.g. Create React App)

preview_player
Показать описание
A quick tip on how you can make your SPA (e.g. a Create-React-App app) or static site's environment variables configurable at runtime — not compile time.
Рекомендации по теме
Комментарии
Автор

This is exactly what I was looking for and explained very clearly. Thanks a lot!

iKlalter
Автор

Thank you!
This is great explanation and trick!
But wouldn't this be unsafe due window object is available from DevTools console?
Can we pass some secret keys this way?

nikitaalekseev
Автор

How could I pass an env like where is the backend url service

dalthonmh