Skip to content

API reference

Hand-curated reference for v0.1.x. Auto-generated docs ship in v0.2 (TypeDoc).

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,

  // Domain types
  type ConfiguredProduct,
  type Product,
  type ProductType,
  type EntitlementBase,
  type DefaultEntitlement,
  type NativeTransaction,
  type VerifiedTransaction,
  type Platform,
  type PurchaseResult,
  type RestoreResult,

  // 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 '@nossdev/iap';

Stability

  • StablecreateIAP, IAP interface methods, all EntitlementBase / Product / PurchaseResult / RestoreResult types, every IAPErrorCode value, every event in EventMap. These follow semver.
  • Stable but advancedBackendAdapter, 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.