#How to shield sensitive functions? SSR not working
4 messages · Page 1 of 1 (latest)
how are you trying to separate these functions from the client right now?
They are currently client side but I want to render them serverside. How can I control where functions are rendered?
Create an injection token for your function, then provide separate implementations in the server.ts than in the client config.
Note though: Your app must work as a fully client-side rendered app, even with SSR. SSR is always optional in Angular and only applies to the initial page load. Further navigations happen entirely on the client and do not involve the SSR server.
If you really must keep things secret (such as an API key) you must hide them behind an API call and run an API server.