# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.2] - 2023-04-20

### Fixed

- Fixed a bug in the embedded experience that prevented cookies from being set in new Chrome versions

## [0.9.1] - 2023-03-07

### Added

- Added `CookieConfig` to all SDK entrypoints to support cookie expiration and sliding to be set

## [0.9.1] - 2023-03-07

### Added

- Added `CookieConfig` to all SDK entrypoints to support cookie expiration and sliding to be set

## [0.9.0] - 2023-02-27

### Added

- Add support for logging in from a SSO session with the new `loginFromSession` method
- Add support for SSO login in the embedded experience

## [0.8.5] - 2023-01-31

### Added

- Updated documentation for the Consent and Preference entities

## [0.8.4] - 2022-12-16

### Added

- Created `getParentDomain` method on EmbeddedHandler

## [0.8.3] - 2022-12-16

### Added

- Implemented an in-memory storage that is used in the embedded experience when cookies are not available

## [0.8.2] - 2022-12-07

### Fixed

- Sets expiration date for the cookie to make it a permanent cookie.

## [0.8.1] - 2022-11-25

### Fixed

- `WireWheelSDK.getToken()` caching

## [0.8.0] - 2022-11-22

### Added

- Embedded experience support

## [0.7.0] - 2022-11-15

### Added

- Updated `login` function to make an api call to merge subjects.
- BREAKING: `login` function now returns a `Promise<void>`.

## [0.6.0] - 2022-10-26

### Added

- New function to retrieve the channel config on the `WirewheelClient.getChannelConfig()` taking a channelId as a parameter.
- Documentation for each entity involved in the response of `getChannelConfig()`.

### Fixed

- Error handler now returns the correct message when an error is thrown.

## [0.5.0] - 2022-09-20

### Added

- New function to register the privacy protocols on a single call on `WireWheelSDK.registerPrivacyProtocols()` accepting [an object](docs/entities/index.md#privacyprotocolsconfig) making use of the apiKey instead of the token to register the gpc consents.

## [0.4.2] - 2022-09-20

### Added

- Support for new `gpc` attribute within the `compliance` in consent creation.

## [0.4.1] - 2022-08-16

### Added

- An anonymous ID is created and attached to the local storage when in a browser environment.
- Subject aware methods (`createConsent`, `getUnifiedConsent` and `hasConsents`) will now read the subject information from the local storage when in a browser environment. Subject is no longer a required parameter for those functions.
- `login` method implemented to store a verifiedId in the user localstorage when in a browser environment
- `logout` method implemented to go back to an anonymousId in the device's localstorage when in a browser environment
- Package was moved to `@wirewheelio` npm scope to avoid collision with private packages. Documentation was updated.

### Fixed

- ClientConfig's `overrideCountry` parameter renamed to `overrideCountryCode` for consistency
- ClientConfig's `overrideRegion` parameter renamed to `overrideRegionCode` for consistency

### Removed

- ClientConfig's `subject` parameter is no longer supported. Passing a subject or reading automatically from localstorage is preferred.
- `hasConsents` method no longer accepts regionCode or countryCode as parameters. ClientConfig must be used to set these values if necessary.

## [0.4.0] - 2022-08-09

### Added

- BREAKING: `createConsent` now accepts [an object](docs/entities/index.md#createconsentpayload) as payload and `CreateConsentPayloadBuilder` has been deprecated.
- Added support for new `compliance` attribute in consent creation

### Fixed

- `saveProfile`, `verifySubjectProfile` and `getProfileVerificationCode` updated to match the latest API endpoints

## [0.3.0] - 2022-08-04

### Added

- `createSubjectProfile` has been renamed to `saveProfile` to better reflect API implementation which creates or updates the profile
- `getProfileVerificationCode` method has been added to explicitly generate a verification code for a subject. `saveProfile` no longer returns a verification code as a side effect of updating or creating a profile.
- Better error handling: requests that error with 400/401/404 now throw a custom error instead of bubbling the axios one.
- [docs] `Scopes` is now documented under the Entities section of the documentation

### Fixed

- `verifySubjectProfile` got updated to be compatible with the newer API contract.

## [0.2.1] - 2022-08-03

### Added

- Implemented hasConsents method in WireWheelClient
- ClientConfig for WireWheelClient instantiation now allows setting overrideCountry and overrideRegion

### Fixed

- `ActionType` is now exported from the main library and can be used to reference the possible values.

## [0.2.0] - 2022-07-26

### Added

- Implemented createSubjectProfile method in WireWheelClient
- Implemented verifySubjectProfile in WireWheelClient

### Fixed

- Now access tokens are cached by scopes

## [0.1.3] - 2022-07-11

### Added

- Project setup: test framework, CI
- Implement `getToken` method
- Implement `createConsent` method
- Implement `getUnifiedConsent` method
- Build process for the library, including esm, cjs and umd builds
- Add example applications for Node (both cjs and esm), Vue and React
