Skip to content

API reference ​

Hand-curated reference for the 8.x (Capacitor 8) line.

Modules ​

PageContents
createIAPFactory function; entry point
IAP instanceAll instance methods
TypesProduct, EntitlementBase, NativeTransaction, VerifiedTransaction, PurchaseResult, RestoreResult
ErrorsIAPError, IAPErrorCode, errorHint, isIAPError
BackendAdapterInterface for custom transports
Events referenceEventMap, EventName, EventPayload, Unsubscribe

Top-level exports ​

typescript
import {
  // Factory
  createIAP,
  type IAP,

  // Errors
  IAPError,
  IAPErrorCode,
  isIAPError,

  // Config
  type IAPConfig,
  type IAPConfigInput,
  type BackendConfig,
  type BackendConfigInput,
  type StorageConfig,
  type OptionsConfig,
  type VerificationConfig,

  // Domain types
  type ConfiguredProduct,
  type Product,
  type ProductType,
  type Storefront,
  type EntitlementBase,
  type DefaultEntitlement,
  type NativeTransaction,
  type VerifiedTransaction,
  type Platform,
  type PurchaseResult,
  type RestoreResult,
  type StorePurchase,
  type SubscriptionOffer,
  type SubscriptionOfferType,
  type SubscriptionOfferPayment,
  type SubscriptionRenewal,
  type SubscriptionState,

  // On-device verification (local mode)
  verifyPurchaseOnDevice,
  isExpired,
  type LocallyVerifiedPurchase,
  type LocalVerification,
  type LocalVerificationError,
  type LocalVerificationOptions,
  type PurchaseAssurance,

  // Events
  type EventMap,
  type EventName,
  type EventPayload,
  type Unsubscribe,

  // Logging
  type Logger,
  type LogLevel,

  // Backend (advanced)
  type BackendAdapter,
  type RestoreRequest,
  type RestoreRequestTransaction,
  type VerifyAppleRequest,
  type VerifyGoogleRequest,
  type VerifyResponse,
  HttpBackendAdapter,
  HttpClient,
  type HttpRequest,

  // Version
  VERSION,
} from '@nosslabs/iap';

Stability ​

  • Stable — createIAP, IAP interface methods, all EntitlementBase / Product / PurchaseResult / RestoreResult types, every IAPErrorCode value, every event in EventMap. These follow semver.
  • Stable but advanced — BackendAdapter, HttpBackendAdapter, HttpClient. Public so non-HTTP transports can be implemented; we reserve the right to add new methods to BackendAdapter in minor versions (additive only).
  • Internal — anything not listed in src/index.ts is private. Don't import from deep paths.

Released under the MIT License. Pairs with Attesto for server-side receipt validation.