Skip to main content
May 9, 2026

New Features

Product Offerings — Pricing API Support

The SDK can now fetch and display product pricing data. Pass a productId to the client to enable pricing methods.
If customerId is also set, it is forwarded to the pricing API so the response reflects that customer’s subscription state.
fetchPricing(forceRefresh?) — Fetch and Cache Pricing
Fetches product offering data for the configured productId. Subsequent calls return the cached result unless forceRefresh is true.
getPricing() — Read from Cache
Returns cached pricing data synchronously, or null if not yet fetched.
getPlan(identifier) — Look Up a Single Plan
Finds an enabled plan by identifier from the pricing cache. Returns null if not found or pricing hasn’t been fetched.
isPricingLoading() — Loading State
Returns true while a pricing fetch is in progress.
getLastPricingError() — Error State
Returns the last Error from a failed pricing fetch, or null.
clearPricingCache() — Reset Cache
Clears cached pricing data and resets loading and error states.

renderPricing(options?) — DOM Binding
Scans the DOM for elements with data-kq-price attributes and populates them with localized formatted prices. Requires pricing data to be fetched first.

kqFormatPrice(amount, currencySymbol, options?) — Price Formatter
Standalone named export for formatting a numeric amount with a currency symbol.

New Types and Exports
February 27, 2026

New Features

Hybrid Aggregation Engine

If a customer has multiple subscriptions (e.g., a base plan + a top-up), the API may return duplicate featureId entries. The SDK now automatically aggregates them into a single Entitlement object per feature — no manual merging required.Aggregation rules:Per-item details (like resetAt and individual hardLimit values) are available on entitlement.items[].

getEntitlements() — Fetch All Entitlements

Returns all aggregated entitlements as a map keyed by featureId. Replaces the old getAllEntitlements() method.

getRawEntitlement(featureId) — Raw Data for a Single Feature

Returns the un-aggregated raw API items for a specific featureId. Useful when you need per-subscription details.

getRawEntitlements() — Full Raw API Response

Returns the complete raw API response including the customerId wrapper, before any aggregation.

ready() — Wait for Initial Fetch

Returns a promise that resolves once the initial entitlement fetch completes. If initializeAndFetch was not set, resolves immediately.

New Type Exports

RawEntitlement and RawEntitlementsApiResponse are now exported for consumers who need to type the raw API objects in their own code.

Breaking Changes

Unified Entitlement Interface

The separate BooleanEntitlement, ConfigEntitlement, and MeteredEntitlement types have been replaced with a single, unified Entitlement interface:
Migration: Replace all references to BooleanEntitlement, ConfigEntitlement, MeteredEntitlement, and AnyEntitlement with Entitlement.

getEntitlement() No Longer Accepts a Type Argument

The generic type parameter and second type argument have been removed. The SDK now determines the feature type automatically.

Renamed Fields

Removed Exports

The following types are no longer exported:
  • BooleanEntitlement, ConfigEntitlement, MeteredEntitlement, AnyEntitlement
  • EntitlementMap is now Record<string, Entitlement> (no union type)

getAllEntitlements() Removed

Use getEntitlements() instead, which returns the aggregated map.

Changed

  • fetchAllEntitlements() deduplicates concurrent calls — Instead of rejecting with “already in progress”, it returns the same in-flight promise. This makes initializeAndFetch: true safely composable with await fetchAllEntitlements().
  • fetchAllEntitlements() stores raw data — Now stores both the full raw API response and the aggregated cache internally.
  • clearCache() clears raw data — Now also clears the stored raw API response.

Fixed

  • initializeAndFetch: false was ignored — The factory used || instead of ??, so passing false had no effect and entitlements were always fetched on initialization. Fixed to use nullish coalescing (??).
  • Options table in documentation — Filled in missing type values for accessToken (string) and onError ((error: Error) => void).