# Changelog

## 1.5.11 (June 18, 2025)

## Enhancements
- Performance improvements for form factor lookups

## Bugfixes
- Fix uninterpolated smart text
- Fix fallback to in-memory storage on localStorage write failures

## 1.5.10 (May 22, 2025)

## Enhancements
- Support focused styling on buttons and toggle
- Support tab key focus for collapsible component
- Support alt tags on images

## Bugfixes
- Fix toggle switch not preserving state on re-render
- Fix additional spacing in text list items
- Fix issue with screenreader and collapsed content

## 1.5.9 (Apr 2, 2025)

## Bugfixes
- Resolve incorrect downscaling on 720p TV devices

## 1.5.8 (Apr 1, 2025)

## Bugfixes
- Resolve an issue where toggle component event was firing twice
- Resolve an issue where toogle switch state was re-rendering due to parent page
- Resolve an issue where additional spacing was being applied

## 1.5.7 (Feb 20, 2025)

## Bugfixes
- Resolve additional type issue encountered with certain initial config files

## 1.5.6 (Feb 19, 2025)

## Bugfixes
- Resolve type issue encountered with certain initial config files

## 1.5.5 (January 16, 2025)

## Enhancements
- Add optional `purchaseChannel` to `NamiConfiguration` to pass through to `NamiPaywallEvent`  analytics

## 1.5.4 (November 29, 2024)

## Bugfixes
- Resolve issue with TV focus with containers and product button on first load

## 1.5.3 (November 21, 2024)

## Bugfixes
- Resolve an issue where the collapse component caret icon was not updating when expanded

## Enhancements
- Support scaling on TV devices for optimal display on 720p, 1080p, 4K, and 8K devices

## 1.5.2 (October 24, 2024)

## Bugfixes
- Fix an issue where the wrong campaign rule was being used for a given placement label
- Fix issue where the wrong initial config campaign rule was being used
- Fix an issue where background video on mobile goes into full screen player
- Fix an issue with focus events on connected TV platforms
- Fix an issue with login / logout state handling
- Fix an issue with free trial and promotional offer display
- Fix several UI issues with carousel and stack components

## 1.5.1 (October 2, 2024)

## Enhancements
- Add `TOGGLE_CHANGE` and `PAGE_CHANGE` paywall events

## Bugfixes
- Fix carousel component swiper
- Fix flex alignment
- Fix hero video not redenering correctly in Safari

## 1.5.0 (September 26, 2024)

## New Features
- Support for advanced video features
- Support for carousel component

## Enhancements
- Improve fallback data handling
- Support repeatable list inside collapse component
- Support vertical alignment on product container
- Align `removeAllListeners` behavior with RN SDK

## Bugfixes
- Fix segment picker cursor
- Fix hidden component handling
- Fix responsive grid spacing and scrolling
- Fix background video and gradient container
- Fix background video position

## 1.4.0 (September 5, 2024)

## New Features
- Support for HLS in Video component
- Support for Responsive Grid component
- Add `NamiCustomerManager.deviceId`
- Add `NamiCustomerManager.registerJourneyStateHandler`, `journeyState` (subscription management-only)
- Add `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management-only)

## Enhancements
- Allow passing product groups to paywall via campaign launch

## Bug Fixes
- Find product by id rather than name
- Fix text component spacing issue

## Improvements
- Modify type definitions for `NamiPaywallManager.registerSignInHandler`, `NamiPaywallManager.registerCloseHandler`, `NamiPaywallManager.registerBuySkuHandler`, `NamiPaywallManager.registerDeeplinkActionHandler`, `NamiCustomerManager.registerAccountStateHandler`, `NamiCampaignManager.launch` handlers to match Nami React Native SDK

## 1.3.2 (August 14, 2024)

### Bug Fixes
  - Support Conditional components based on product entitlement
  - Respect conditions based on product groups

## 1.3.1 (August 12, 2024)

### Bug Fixes
  - `SHOW_PAYWALL` event action is being triggered as `UNKNOWN`

## 1.3.0 (August 12, 2024)

### New Features
- **NamiEntitlementManager** - Implemented `NamiEntitlementManager` for Nami to manage entitlements.
- **NamiEntitlementManager.active** - Retrieve all active entitlements for a user on the current device.
- **NamiEntitlementManager.isEntitlementActive** - Check if a single entitlement is currently active.
- **NamiEntitlementManager.refresh** - Manually trigger a refresh of the user's latest active entitlements from the Nami services.
- **NamiEntitlementManager.registerActiveEntitlementsHandler** - Register a callback to react to a potential changes to the active entitlements for the user
- **NamiEntitlement** - Object that contains data about an entitlement on the Nami Platform.
- **Support hidden components** - Hide components without removing them from your paywalls.
- **New components** - Video and collapsable components.
- **Improved timeout and error handling**

### Bug Fixes
- Provide consistent typing with other Nami SDKs.
- Updated the JavaScript version to ECMAScript2021 for better backward compatability.

### Breaking changes
- `NamiConfiguration`'s `appPlatformId` is now `appPlatformID` for consistentcy with other Nami SDKs
- `NamiPaywallManager.buySkuComplete` has a much simpler (but modified) interface.

## 1.2.0 (July 26, 2024)

### New Features
- **NamiCampaignManager.launch** - Implemented `paywallLaunchContext` in `NamiCampaignManager.launch` in order to provide the paywall additional details.
- **NamiPaywallManager.buySKUCancel** - Implemented `NamiPaywallManager.buySKUCancel` to let Nami know the user has canceled their paywall purchase.
- **NamiPayallManager.buySKUComplete** - Implemented `NamiPaywallManager.buySKUComplete` to let Nami know the user has completed their paywall purchase.
- **Impression / Conversion Reporting** - Implemented impression / conversion reporting for paywall analytics.
- **Improved paywall load time** - Paywalls render signficantly faster when immediately displayed.

### Bug Fixes
- Provide consistent typing with other Nami SDKs.
- Provide consistent APIs with other Nami SDKs.

## 1.1.0 (June 24, 2024)

### New Features
- **NamiCustomerManager.setAnonymousMode** - Method to enable anonymous mode for the customer, concealing their identity from system tracking for privacy.
- **NamiCampaignManager.launch** - Implemented the `paywallActionHandler` to allow registering a callback to receive paywall-related events.
- **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback invoked when the user initiates a purchase action.

### Bug Fixes
- Resolved compatibility issues with the Lit web component library and server-side rendering.
- Fixed rendering issues with subscription periods and pricing in paywalls.
- Fixed connectivity issues related to custom API hosts.
- Enhanced the display for different icons.

### Known Issues
- `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
- Impression or conversion reporting not yet implemented.
- Launch context is not yet implemented.

## 1.0.0 (June 13, 2024)

### New Features
- **Nami** - Introduced `Nami` to provide core functionality to initialize the SDK.
  - **Nami.configure** -Method to initialize and configure the SDK using a `NamiConfiguration` object.
  - **NamiConfiguration** - Defines the structure of the configuration object used by `Nami.configure`.
  - **NamiLanguageCodes** - Defines the languages supported by Nami paywalls.

 - **NamiCampaignManager** - Introduced `NamiCampaignManager` to launch paywalls and manage campaigns.
   - **NamiCampaignManager.launch** - Method to launch paywalls.
   - **NamiCampaignManager.allCampaigns** - Method to get a list of available `NamiCampaign`s.
   - **NamiCampaignManager.isCampaignAvailable** - Method to check if a matching campaign is available, returning a boolean.
   - **NamiCampaignManager.refresh** - Method to request that available campaigns be refreshed.
   - **NamiCampaignManager.registerAvailableCampaignsHandler** - Method to register a callback that is called when campaigns are updated.
   - **NamiCampaign** - Defines the structure of the campaign objects.
   
- **NamiCustomerManager** - Introduced `NamiCustomerManager` to manager customer related functionality.
  - **NamiCustomerManager.isLoggedIn** - Method to check if a customer is logged in, returning a boolean.
  - **NamiCustomerManager.loggedInId** - Method to get the unique customer identifier associated with the current device.
  - **NamiCustomerManager.login** - Method to provide a customer id to link one or more devices to a known customer.
  - **NamiCustomerManager.logout** - Method to disassociate a device from a customer identifier.
  - **NamiCustomerManager.registerAccountStateHandler** - Method to register a callback that is called when a customer is logged in or logged out.
  - **NamiCustomerManager.setCustomerAttribute** - Method to set an attribute in an on-device key/value store for use for paywall personalization uses cases.
  - **NamiCustomerManager.getCustomerAttribute** - Method to get the current stored value, if available, for the provided key in the on-device customer key/value store.
  - **NamiCustomerManager.clearCustomerAttribute** - Method to remove a key from the on-device customer key/value store.
  - **NamiCustomerManager.clearAllCustomerAttributes** - Method to clear all customer attributes in the on-device key/value store.
  - **NamiCustomerManager.setAnonymousMode** - Method to set the anonymous mode for the customer.

- **NamiPaywallManager** - Introduce `NamiPaywallManager` to manage paywalls.
  - **NamiPaywallManager.setProductDetails** - Method to set product and price details to be used by the paywall.
  - **NamiPaywallManager.registerSignInHandler** - Method to register a callback for when the customer clicks a sign in button on the paywall.
  - **NamiPaywallManager.registerCloseHandler** - Method to register a callback for when the customer clicks on a close button on the paywall.
  - **NamiPaywallManager.registerDeeplinkActionHandler** - Method to register a callback for when a customer clicks on a deeplink button on the paywall.
  - **NamiPaywallManager.registerBuySkuHandler** - Method to register a callback for when a customer clicks on a buy button on the paywall.
  - **NamiPaywallManager.registerRestoreHandler** - Method to register a callback wfor when a customer clicks to restore a previous purchase.
  - **NamiPaywallManager.buySkuComplete** - Method to notify Nami SDK when a purchase succeeded for conversion reporting.
  - **NamiPaywallManager.buySkuCancel** - Method to notify Nami SDK when a user cancelled the purchase flow, or an error occurred.

### Known Issues
- When user actions are taken on the paywall, paywall callbacks are not being called. 
- `NamiPaywallManager`'s `buySkuComplete` and `buySkuCancel` methods are not fully implemented.
- `NamiCustomerManager`'s `setAnonymousMode` method is not fully implemented.
- Impression or conversion reporting not yet implemented
- Launch context is not yet implemented

### Additional Notes
Please refer to the documentation for detailed usage instructions and examples.
