Next.js · Senior · Question 50 of 75
Why do Server Actions get encrypted, non-deterministic IDs?
- ✓Correct answer: So the IDs are hard to guess and unused actions can be removed
- 2To speed up calls thanks to a short name in the request
- 3To completely hide action calls from the browser's DevTools
Explanation
Next.js creates IDs for action references and periodically recalculates them between builds; unused Server Actions are removed from the client bundle (dead code elimination). But any used ID is visible in network requests - so permission checks inside the action are mandatory.