Skip to content

AuthResponse

Defined in: packages/auth/src/types/response.ts:26

Discriminated result shape returned by every public AuthClient method. Extends the generic APIResponse<T> from @eventista/sdk-api-client with a stable, semantic code from AUTH_ERROR_CODES.

  • When isErr is false, data is set and code / errorCode / err are all undefined.
  • When isErr is true, code (SDK semantic code) is set, errorCode (raw upstream code, when available) is set, err carries the human message, and data is undefined.

Consumers branch on result.isErr and then on result.code. The raw errorCode is exposed unchanged so it can be surfaced in support tickets without parsing the message.

  • APIResponse<T>

T

optional code?: AuthErrorCode

Defined in: packages/auth/src/types/response.ts:31

Stable, semantic auth error code from AUTH_ERROR_CODES. Only present when isErr is true.


optional data?: T

Defined in: packages/api-client/dist/index.d.ts:177

APIResponse.data


optional err?: string

Defined in: packages/api-client/dist/index.d.ts:175

APIResponse.err


optional errorCode?: string | number

Defined in: packages/api-client/dist/index.d.ts:176

APIResponse.errorCode


isErr: boolean

Defined in: packages/api-client/dist/index.d.ts:174

APIResponse.isErr