unknown is a type-safe version of any. You must narrow it before use.
let value: unknown = getExternalData();
// Error: can't use unknown directly
value.toString();
// OK: narrowed with type check
if (typeof value === "string") {
console.log(value.toUpperCase());
}
Use unknown for data from external sources.