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
| Type | Description |
|---|---|
HyperyAuthConfig | HyperyProvider config. See config options. |
AuthContextValue | Return value of useAuth / useHyperyAuth. See useAuth. |
AuthState | Base 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
| Type | Description |
|---|---|
AuthModalProps | AuthModal props. |
AuthButtonProps | AuthButton props. |
ModernAuthFormProps | ModernAuthForm props. |
WorkspaceSwitcherProps | WorkspaceSwitcher props. |
BuyButtonProps | BuyButton props. |
SubscribeButtonProps | SubscribeButton props. |
HyperyModalsProps | HyperyModals props. |
SpendingLimitAlertProps | SpendingLimitAlert props. |
InsufficientCreditsAlertProps | InsufficientCreditsAlert props. |
ErrorBoundaryProps | ErrorBoundary 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
| Type | Description |
|---|---|
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(). |
Wallet
| Type | Description |
|---|---|
UseWalletReturn | Return value of useWallet. |
WalletState | Wallet 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'. |
UseBuyerWalletReturn | Return value of useBuyerWallet. |
BuyerPaymentMethod | { id, brand, last4, expMonth, expYear, isDefault } saved marketplace card. |
AddCardOptions | { successUrl?, cancelUrl? } for addCard(). |
Checkout, marketplace & subscriptions
| Type | Description |
|---|---|
UseCheckoutReturn | Return 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? }. |
UseMarketplaceReturn | Return value of useMarketplace. |
BuyInput | { appId, amountCents, description?, paymentMethodId?, idempotencyKey? }. |
BuyResult | BuySuccess | BuyFailure, discriminated on ok. |
BuySuccess | { ok: true, paymentIntentId, status, amountCents, applicationFeeCents }. |
BuyFailure | { ok: false, error, needsPaymentMethod, needsAuth }. |
UseAppSubscriptionReturn | Return value of useAppSubscription. |
AppPlan | A 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'. |
AppSubscription | A 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
| Type | Description |
|---|---|
ParsedError | Classified error from parseError: code, message, type?, status?, the is* flags, data. |
UseErrorReturn | Return value of useError. |
RestrictionError | Raw error object accepted by RestrictionModal. |
ErrorResponse | { error: ErrorData } — the gateway's error envelope. |
ErrorData | Union of the error data types below. |
SpendingLimitErrorData | SPENDING_LIMIT_EXCEEDED: limitType, limit, current, requested, resetsAt?. |
InsufficientCreditsErrorData | INSUFFICIENT_CREDITS: available, required. |
PaymentMethodRequiredErrorData | PAYMENT_METHOD_REQUIRED. |
PaymentDeclinedErrorData | PAYMENT_DECLINED: reason?. |
AuthenticationErrorData | UNAUTHENTICATED. |
GenericErrorData | Any other { code, message, type?, ... }. |
Streaming
| Type | Description |
|---|---|
SSEEvent | { event?, data } — one parsed frame. See Streaming. |
SSEStreamHandlers | { onData?, onError?, onDone? } for consumeSSEStream. |