Calling response.json() gives data from outside your program. A TypeScript annotation cannot prove that a server actually returned that shape.
JSON is unknown
TypeScript
const response = await fetch("/api/user"); const data: unknown = await response.json();
Validate at the boundary
Use a type guard to test the data before your application uses it. This keeps uncertainty at the network boundary instead of pretending a cast has made untrusted data safe.
Did you know my courses are all printer-friendly? This means you can easily export them to PDF or print them for later use.
