Define the boundary
A client should not have to infer success from a response message. Use HTTP status codes and stable structured response fields.
type Result<T> = { ok: true; data: T } | { ok: false; error: string };
Validate inputs
Runtime validation remains necessary even when both sides use TypeScript. Treat network data as untrusted and return actionable validation errors.
Plan changes
Prefer additive changes to existing contracts. Test error responses as carefully as successful responses.




