Too Long; Didn't Read
Files offered for download to subscribers or customers should not be put in the public folder of Next.js because they will be freely accessible.
There are three feasible ways to protect a file, and which one you choose depends on the level of acceptable risk and how valuable the file is.
The core idea is to use an API endpoint that checks the user’s credentials and serves the protected file if everything is OK.