Options
All
  • Public
  • Public/Protected
  • All
Menu

Stigg Node.js SDK client

Hierarchy

  • Stigg

Implements

Index

Methods

  • addListener<K>(eventName: K, listener: Events[K]): void
  • archiveCustomer(customerId: string): Promise<string>
  • close(): void
  • Discards all network connections, background tasks, and other resources held by the client.

    Do not attempt to use the client after calling this method.

    Returns void

  • detachCustomerPaymentMethod(customerId: string): Promise<SlimCustomer>
  • getCoupons(): Promise<Coupon[]>
  • getEntitlements(customerId: string, resourceId?: string): Promise<undefined | Entitlement[] | ({ accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean } | { accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean; isUnlimited?: boolean; value?: number } | { accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean; isUnlimited?: boolean; usageLimit?: number })[]>
  • Get entitlements per user

    Parameters

    • customerId: string
    • Optional resourceId: string

    Returns Promise<undefined | Entitlement[] | ({ accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean } | { accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean; isUnlimited?: boolean; value?: number } | { accessDeniedReason: AccessDeniedReason; feature: { id: string }; hasAccess: boolean; isFallback: boolean; isUnlimited?: boolean; usageLimit?: number })[]>

  • Import a Customer from billing integration. Private information such as email and name are not imported and needs to be send in order to be persisted in Stigg. Active billing integration is required for this functionality.

    Parameters

    Returns Promise<SlimCustomer>

    Newly created customer. Throw exception on errors.

  • Migrate subscription to latest plan and addons version and pricing. using SubscriptionMigrationTime.EndOfBillingPeriod is possible only if Stripe integration is enabled and will migrate the subscription in the end of the current billing period. Using Immediate will perform the migration imidietly. Default, migration will happen imidietly.

    Parameters

    Returns Promise<{ subscriptionId: string }>

    The subscription id

  • reloadEntitlements(customerId: string, resourceId?: string): Promise<{ entitledEntityExists: boolean }>
  • Reload entitlements of a customer or customer resource. Note: this method skips the Edge API, so use it only when you need "read-after-write" consistency after entitlements presumably have changed.

    Parameters

    • customerId: string
    • Optional resourceId: string

    Returns Promise<{ entitledEntityExists: boolean }>

  • removeListener<K>(eventName: K, listener: Events[K]): void
  • Remove a listener to stop handle updates of entitlements changes and usage changes

    Type parameters

    Parameters

    • eventName: K
    • listener: Events[K]

    Returns void

  • unarchiveCustomer(customerId: string): Promise<SlimCustomer>
  • waitForInitialization(): Promise<Stigg>
  • Initialize an instance of the Stigg SDK client.

    Parameters

    Returns Stigg

    stigg SDK instance.

Generated using TypeDoc