Types reference

Every TypeScript type exported by @hyperyai/sdk, grouped by area, with a one-line description and a link to where it is used.

All types are exported from the package root:

import type { HyperyAuthConfig, ParsedError, AppPlan } from '@hyperyai/sdk';

Provider & auth

TypeDescription
HyperyAuthConfigHyperyProvider config. See config options.
AuthContextValueReturn value of useAuth / useHyperyAuth. See useAuth.
AuthStateBase of AuthContextValue: { user, isAuthenticated, isLoading, error, isLoggingOut? }.
User{ id, email, name, image? }.
AuthTokens{ accessToken, refreshToken, expiresIn, tokenType }. See TokenStorage.
InteractionMode'auto' | 'popup' | 'redirect' — config value for interactive steps.
ResolvedMode'popup' | 'redirect'InteractionMode after resolving auto.
PopupAuthResult{ ok, blocked, cancelled } returned by loginPopup().
LoginOptions{ provider?: 'google' | 'github' } for login() / loginPopup()provider skips the hosted login page. See useAuth.
BrandingConfig{ logo?, appName?, primaryColor? } for buttons and auth forms.

Component props

TypeDescription
AuthModalPropsAuthModal props.
AuthButtonPropsAuthButton props.
ModernAuthFormPropsModernAuthForm props.
WorkspaceSwitcherPropsWorkspaceSwitcher props.
BuyButtonPropsBuyButton props.
SubscribeButtonPropsSubscribeButton props.
HyperyModalsPropsHyperyModals props.
SpendingLimitAlertPropsSpendingLimitAlert props.
InsufficientCreditsAlertPropsInsufficientCreditsAlert props.
ErrorBoundaryPropsErrorBoundary props.

SignIn, SignUp, SignInForm, UserButton, UserProfile, the control components and RestrictionModal don't export their props types; use React.ComponentProps<typeof SignIn> if you need them.

Workspaces

TypeDescription
MembershipsResponse{ activeOrganizationId, activeWorkspaceId, memberships } from useMemberships().data.
MembershipEntry{ team: MembershipTeam, workspaces: MembershipWorkspace[] }.
MembershipTeam{ id, name, slug, isPersonal, role }.
MembershipWorkspace{ id, name, slug, isDefault, icon, role, isActive }.
ActiveWorkspace{ teamId, teamName, workspaceId, workspaceName, role } from useActiveWorkspace().

See Workspaces & memberships.

Wallet

TypeDescription
UseWalletReturnReturn value of useWallet.
WalletStateWallet snapshot: mode, balance, card, auto top-up, low balance, tiers, settings URLs.
WalletTier{ name, usdAmount, credits, bonus, popular? } top-up tier.
BillingMode'metered' | 'prepaid' | 'vag_passthrough'.
UseBuyerWalletReturnReturn value of useBuyerWallet.
BuyerPaymentMethod{ id, brand, last4, expMonth, expYear, isDefault } saved marketplace card.
AddCardOptions{ successUrl?, cancelUrl? } for addCard().

Checkout, marketplace & subscriptions

TypeDescription
UseCheckoutReturnReturn value of useCheckout.
CheckoutInput{ kind: 'purchase', ... } | { kind: 'topup', ... } | { kind: 'subscription', ... }.
CheckoutStatus'idle' | 'authenticating' | 'charging' | 'adding-card' | 'redirecting' | 'success' | 'error' | 'cancelled'.
CheckoutResult{ status: 'success' | 'error' | 'cancelled' | 'redirecting', data?, error? }.
UseMarketplaceReturnReturn value of useMarketplace.
BuyInput{ appId, amountCents, description?, paymentMethodId?, idempotencyKey? }.
BuyResultBuySuccess | BuyFailure, discriminated on ok.
BuySuccess{ ok: true, paymentIntentId, status, amountCents, applicationFeeCents }.
BuyFailure{ ok: false, error, needsPaymentMethod, needsAuth }.
UseAppSubscriptionReturnReturn value of useAppSubscription.
AppPlanA plan: { id, appId, name, description, priceCents, currency, interval, prices?, grants }.
AppPlanPrice{ interval, priceCents }.
AppPlanGrant{ type, amountUsd, expiresAfterDays, issueOn } credit grant a plan issues.
PlanInterval'month' | 'year'.
AppSubscriptionA subscription: { id, appId, plan, status, cancelAtPeriodEnd, currentPeriodEnd, interval?, pendingInterval?, nextGrantAt?, grants }.
AppSubscriptionGrantBalance{ type, amountUsd, remainingUsd, expiresAt }.
SwitchIntervalResult{ success, changed, effective?, at?, subscription?, error? } from switchInterval().

Errors

TypeDescription
ParsedErrorClassified error from parseError: code, message, type?, status?, the is* flags, data.
UseErrorReturnReturn value of useError.
RestrictionErrorRaw error object accepted by RestrictionModal.
ErrorResponse{ error: ErrorData } — the gateway's error envelope.
ErrorDataUnion of the error data types below.
SpendingLimitErrorDataSPENDING_LIMIT_EXCEEDED: limitType, limit, current, requested, resetsAt?.
InsufficientCreditsErrorDataINSUFFICIENT_CREDITS: available, required.
PaymentMethodRequiredErrorDataPAYMENT_METHOD_REQUIRED.
PaymentDeclinedErrorDataPAYMENT_DECLINED: reason?.
AuthenticationErrorDataUNAUTHENTICATED.
GenericErrorDataAny other { code, message, type?, ... }.

Streaming

TypeDescription
SSEEvent{ event?, data } — one parsed frame. See Streaming.
SSEStreamHandlers{ onData?, onError?, onDone? } for consumeSSEStream.