Closed justinmchase closed 1 month ago
Hi, @justinmchase Thanks for reaching out. Thanks for using Azure App Config JS provider.
Currently, Azure App Config JS provider(v1) only targets on the node.js(backend server) scenario. We don't expect JS provider will run in the browser for 2 reasons:
But, Azure App Config is going to support SAS token and we are going to explore the client-side story. We will suggest our users to use CDN (e.g Azure Front Door). The CDN should talk with App Config with SAS token and the client should load configuration from CDN. You can see we have a PR on the way. The CDN support will be added in the next preview release (v2). Our plan is to release v2 preview in the next month.
That being said I can't seem to find a react sample repo. Are any available?
Actually, I have one example here. But this example is not in a very good shape for demo. I am working on another web app example. When I finish it, I will let you know.
This web app used express as backend and use react for frontend. The App Config JS provider runs in the node.js backend. The JS feature management runs in the react app which will be run in the browser. To use feature flag in Azure App Configuration, you will need to use our feature management library (which is developed with supporting both node.js and browser in mind). The JS feature management has been GA and the public docs will be ready soon.
The connection string/credential needs to be put somewhere in the code which runs in the browser (unsafe)
They key to solving this simply is to just realize that the connection string / credential isn't actually a secret on the front end and it's not actually a problem if it's exposed.
This is the way all the others do it, launch darkly, app insights and Google analytics also just let you put the token right in the code no big deal.
What's the worst that could happen? Someone can see your feature flags and config? Send weird user contexts? No big deal.
Anyway, thanks for the answer.
The connection string/credential needs to be put somewhere in the code which runs in the browser (unsafe)
They key to solving this simply is to just realize that the connection string / credential isn't actually a secret on the front end and it's not actually a problem if it's exposed.
This is the way all the others do it, launch darkly, app insights and Google analytics also just let you put the token right in the code no big deal.
What's the worst that could happen? Someone can see your feature flags and config? Send weird user contexts? No big deal.
Anyway, thanks for the answer.
Our standard tier has the quota: 30,000 per hour. There will be potential throttling issue if you send request to App Config directly from client side.
Hi, @justinmchase
I created this quote of the day example.
Not sure why anyone would want feature flags on the backend, but the front-end is the most obvious target. That being said I can't seem to find a react sample repo. Are any available?