Skip to content

Latest commit

 

History

History
111 lines (93 loc) · 7.64 KB

TYPES.md

File metadata and controls

111 lines (93 loc) · 7.64 KB

Type reference

Every type exported from @hyperyai/sdk, grouped, one line each. Import with import type { ... } from '@hyperyai/sdk'.

Back to README

Provider and auth

Type Description Details
HyperyAuthConfig HyperyProvider config prop. PROVIDER.md
InteractionMode 'auto' | 'popup' | 'redirect'. PROVIDER.md
ResolvedMode 'popup' | 'redirect' after resolving auto. PROVIDER.md
BrandingConfig { logo?, appName?, primaryColor? }. PROVIDER.md
AuthContextValue Value returned by useAuth() / useHyperyAuth(). PROVIDER.md
AuthState { user, isAuthenticated, isLoading, error, isLoggingOut? } (base of AuthContextValue). PROVIDER.md
PopupAuthResult { ok, blocked, cancelled } from loginPopup(). PROVIDER.md
PostLogoutRedirect string | false | null | (() => string | false | null | void) — where logout() goes. PROVIDER.md
LoginOptions { provider?: 'google' | 'github' } for login() / loginPopup(). PROVIDER.md
User { id, email, name, image? }. HOOKS.md
AuthTokens { accessToken, refreshToken, expiresIn, tokenType }. ADVANCED.md

Component props

Type Component Details
AuthButtonProps AuthButton COMPONENTS.md
AuthModalProps AuthModal COMPONENTS.md
ModernAuthFormProps ModernAuthForm COMPONENTS.md
WorkspaceSwitcherProps WorkspaceSwitcher COMPONENTS.md
BuyButtonProps BuyButton CHECKOUT.md
SubscribeButtonProps SubscribeButton CHECKOUT.md
HyperyModalsProps HyperyModals ERRORS.md
SpendingLimitAlertProps SpendingLimitAlert ERRORS.md
InsufficientCreditsAlertProps InsufficientCreditsAlert ERRORS.md
ErrorBoundaryProps ErrorBoundary ERRORS.md
RestrictionError RestrictionModal error prop (flat error object). ERRORS.md

Workspaces

Type Description Details
MembershipsResponse { activeOrganizationId, activeWorkspaceId, memberships }. HOOKS.md
MembershipEntry { team, workspaces }. HOOKS.md
MembershipTeam { id, name, slug, isPersonal, role }. HOOKS.md
MembershipWorkspace { id, name, slug, isDefault, icon, role, isActive }. HOOKS.md
ActiveWorkspace { teamId, teamName, workspaceId, workspaceName, role }. HOOKS.md

Wallets

Type Description Details
BillingMode 'metered' | 'prepaid' | 'vag_passthrough'. HOOKS.md
WalletState Snapshot from GET /api/wallet/state. HOOKS.md
WalletTier { name, usdAmount, credits, bonus, popular? }. HOOKS.md
UseWalletReturn Return of useWallet. HOOKS.md
BuyerPaymentMethod { id, brand, last4, expMonth, expYear, isDefault }. HOOKS.md
AddCardOptions { successUrl?, cancelUrl? }. HOOKS.md
UseBuyerWalletReturn Return of useBuyerWallet. HOOKS.md

Checkout and marketplace

Type Description Details
CheckoutInput purchase / topup / subscription union (subscription accepts teamId?). CHECKOUT.md
SubscribeSessionResult Authoritative hosted subscribe session outcome (status, state, team, subscription). CHECKOUT.md
CheckoutStatus Flow status string union. CHECKOUT.md
CheckoutResult { status, data?, error? }. CHECKOUT.md
UseCheckoutReturn Return of useCheckout. CHECKOUT.md
BuyInput Input of useMarketplace().buy. CHECKOUT.md
BuySuccess { ok: true, paymentIntentId, status, amountCents, applicationFeeCents }. CHECKOUT.md
BuyFailure { ok: false, error, needsPaymentMethod, needsAuth }. CHECKOUT.md
BuyResult BuySuccess | BuyFailure. CHECKOUT.md
UseMarketplaceReturn Return of useMarketplace. CHECKOUT.md

Subscriptions

Type Description Details
PlanInterval 'month' | 'year'. CHECKOUT.md
AppPlan A plan of your app. CHECKOUT.md
AppPlanPrice { interval, priceCents }. CHECKOUT.md
AppPlanGrant Credit grant configured on a plan. CHECKOUT.md
AppSubscription A user's subscription with grant balances and owning team: { id, name, slug } | null. CHECKOUT.md
AppSubscriptionGrantBalance { type, amountUsd, remainingUsd, expiresAt }. CHECKOUT.md
SwitchIntervalResult Result of switchInterval. CHECKOUT.md
UseAppSubscriptionOptions { teamId?: string } for useAppSubscription. CHECKOUT.md
UseAppSubscriptionReturn Return of useAppSubscription. CHECKOUT.md

Errors

Type Description Details
ParsedError Normalized, classified error. ERRORS.md
ErrorData Union of the error payloads below. ERRORS.md
ErrorResponse { error: ErrorData } envelope. ERRORS.md
SpendingLimitErrorData SPENDING_LIMIT_EXCEEDED payload. ERRORS.md
InsufficientCreditsErrorData INSUFFICIENT_CREDITS payload. ERRORS.md
PaymentMethodRequiredErrorData PAYMENT_METHOD_REQUIRED payload. ERRORS.md
PaymentDeclinedErrorData PAYMENT_DECLINED payload. ERRORS.md
AuthenticationErrorData UNAUTHENTICATED payload. ERRORS.md
GenericErrorData { code, message, type?, [key]: any }. ERRORS.md
UseErrorReturn Return of useError. HOOKS.md

Streaming

Type Description Details
SSEEvent { event?, data }. STREAMING.md
SSEStreamHandlers { onData?, onError?, onDone? }. STREAMING.md