Skip to content

@swapped/connect-sdk / core / SessionView

Type Alias: SessionView

SessionView = { type: Active; } | { transaction?: SessionCompletedTransaction; type: Completed; } | { country: string; rejectReason: string | null; type: RejectedRegion; } | { type: RejectedCompliance; } | { type: Expired; } | { type: Failed; } | { type: AwaitingConfirmation; } | { type: AwaitingEmailConfirmation; } | { type: Maintenance; }

Defined in: src/modules/session/session-view.types.ts:20

Discriminated session screen state for routing UI.

Prefer useSessionView over reading session fields directly for screen gates.

Union Members

Type Literal

{ type: Active; }


Type Literal

{ transaction?: SessionCompletedTransaction; type: Completed; }

transaction?

optional transaction?: SessionCompletedTransaction

Completed transaction details when available.

type

type: Completed


Type Literal

{ country: string; rejectReason: string | null; type: RejectedRegion; }

country

country: string

ISO country code that blocked the session.

rejectReason

rejectReason: string | null

Server-provided rejection message when available. May include \n line breaks — preserve them in UI (e.g. CSS white-space: pre-line).

type

type: RejectedRegion


Type Literal

{ type: RejectedCompliance; }


Type Literal

{ type: Expired; }


Type Literal

{ type: Failed; }


Type Literal

{ type: AwaitingConfirmation; }


Type Literal

{ type: AwaitingEmailConfirmation; }


Type Literal

{ type: Maintenance; }