Skip to content

ApiResponse<T>

@blobs/sdk v0.1.0


@blobs/sdk / types/Common / ApiResponse

Defined in: types/Common.ts:14

Standard envelope returned by the API and SDK transport layer.

success is the discriminator: when true, data is populated; when false, error (and optionally message/code) describe what went wrong. SDK services typically unwrap this and return the inner data directly.

Type Parameters

T

T = any

The shape of the payload when success is true.

Properties

success

success: boolean

Defined in: types/Common.ts:16

Whether the request succeeded. Acts as the discriminator for data vs error.


data?

optional data?: T

Defined in: types/Common.ts:18

Successful response payload. Present when success is true.


error?

optional error?: string

Defined in: types/Common.ts:20

Short, machine-readable error string. Present when success is false.


message?

optional message?: string

Defined in: types/Common.ts:22

Human-readable message accompanying success or error responses.


code?

optional code?: string

Defined in: types/Common.ts:24

Stable error or transport code (e.g., UNAUTHORIZED, NOT_FOUND) for handling.