Server functions: how to preventing leaking server-only code (e.g. secrets) into client javascript?
How to server functions prevent leaking server-only code (secrets) into client bundles?
As I understand, to use server functions, you directly import them via the bundler. This means all the typescript/javascript needed to run the server-side RPC are, at least at bundle time, before tree-shaking, visible in a client bundle.
How is this prevented currently? Is there a better approach?
1 Reply
multiple-amethyst•7mo ago
Server Functions | TanStack Start React Docs
What are Server Functions? Server functions allow you to specify logic that can be invoked almost anywhere (even the client), but run only on the server. In fact, they are not so different from an API...