Skip to content

parseApiResponse

parseApiResponse<T>(value): APIResponse<T> | undefined

Defined in: packages/api-client/src/rest/types/response.ts:43

Validate that an unknown value matches the APIResponse envelope shape (an object with a boolean isErr). Returns undefined when the value is missing or malformed, so callers can safely fall through to a generic error response instead of trusting an as cast.

The inner data field is not validated here — domain code (e.g. mapTokens, mapUser in @eventista/sdk-auth) is responsible for shape-checking the payload it consumes.

T

unknown

APIResponse<T> | undefined