@liquidcommercedev/rmn-sdk 1.4.0-beta.1 → 1.4.1-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ ## [1.4.1-beta.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.4.0...v1.4.1-beta.1) (2024-10-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fixes ([116ba93](https://github.com/liquidcommerce/rmn-sdk/commit/116ba930a9d38e231e1248ad73a38d344992498b))
7
+ * fixes ([169dab1](https://github.com/liquidcommerce/rmn-sdk/commit/169dab1b780a7594eaff5610b32299a64d849a8a))
8
+ * readme fix ([8af0252](https://github.com/liquidcommerce/rmn-sdk/commit/8af0252e7108b88f7438c39780024a9757f63e4d))
9
+ * spot config - redirect on click ([55517f7](https://github.com/liquidcommerce/rmn-sdk/commit/55517f754bd0c1c2a91967fc79b54699a13771de))
10
+
11
+ # [1.4.0](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.1...v1.4.0) (2024-10-03)
12
+
13
+
14
+ ### Features
15
+
16
+ * added events type ([278cf44](https://github.com/liquidcommerce/rmn-sdk/commit/278cf449619218b6826a1f0ca141fc988007987a))
17
+ * button on hover color ([70b1839](https://github.com/liquidcommerce/rmn-sdk/commit/70b1839100709b5a41a3d1ba14eae56d4f05889c))
18
+ * design changes ([2142ee5](https://github.com/liquidcommerce/rmn-sdk/commit/2142ee5685250636a2ab728f424d67dcb101e097))
19
+ * export event interface ([0ca5a76](https://github.com/liquidcommerce/rmn-sdk/commit/0ca5a762d5906de82073627a4e1f016462f2a6c9))
20
+ * fix fonts ([2d65e44](https://github.com/liquidcommerce/rmn-sdk/commit/2d65e44e8b24d446c78ad97005db2bb8c1004c92))
21
+ * new spot content and design fixes and new rb variant ([2efd32d](https://github.com/liquidcommerce/rmn-sdk/commit/2efd32db2264920f9653c1436b670043ad9f5723))
22
+ * new variant design ([11623b9](https://github.com/liquidcommerce/rmn-sdk/commit/11623b99ba3a74d3c92d87b32da139bd97f1a339))
23
+ * remove filter blur ([355a302](https://github.com/liquidcommerce/rmn-sdk/commit/355a30270d8a8388fbef8bcccab2491518015006))
24
+ * support cta color ([a2df5eb](https://github.com/liquidcommerce/rmn-sdk/commit/a2df5eb3a9d15a0719c408936aa4781f09190673))
25
+ * support cta color ([26a637e](https://github.com/liquidcommerce/rmn-sdk/commit/26a637e90ad54dee5acb36b35177c45a8c6b72f2))
26
+
1
27
  # [1.4.0-beta.1](https://github.com/liquidcommerce/rmn-sdk/compare/v1.3.1...v1.4.0-beta.1) (2024-10-03)
2
28
 
3
29
 
package/README.md CHANGED
@@ -61,7 +61,7 @@ import { RmnClient } from '@liquidcommercedev/rmn-sdk';
61
61
  import { RmnClient } from '@liquidcommercedev/rmn-sdk';
62
62
  // Your Account token provided to you through your account representative
63
63
  const client = await RmnClient('YOUR_API_KEY', {
64
- env: 'dev'
64
+ env: 'staging'
65
65
  });
66
66
  ```
67
67
 
@@ -78,17 +78,12 @@ An example use case for LiquidCommerce's `spotSelection({})` method.
78
78
  import RmnClient from '@liquidcommercedev/rmn-sdk';
79
79
  // Your Account token provided to you through your account representative
80
80
  const client = await RmnClient('YOUR_API_KEY', {
81
- env: 'dev'
81
+ env: 'staging'
82
82
  });
83
83
 
84
- const { spots } = await client.spotSelection({
84
+ const spots = await client.spotSelection({
85
85
  "spots": ['billboard', 'leaderboard']
86
86
  });
87
87
 
88
- console.log('spots: ', spots);
89
- ```
90
-
91
- >
92
- > **CURRENTLY IN PRIVATE BETA UNDERGOING FINAL UAT FOR PRODUCTION RELEASE.**
93
- >
94
- >
88
+ console.log({ spots });
89
+ ```
package/dist/index.d.ts CHANGED
@@ -48,6 +48,8 @@ declare enum RMN_FILTER_PROPERTIES {
48
48
  SECTION = "section"
49
49
  }
50
50
  declare enum RMN_SPOT_EVENT {
51
+ IMPRESSION = "IMPRESSION",
52
+ CLICK = "CLICK",
51
53
  PURCHASE = "PURCHASE",
52
54
  ADD_TO_CART = "ADD_TO_CART",
53
55
  ADD_TO_WISHLIST = "ADD_TO_WISHLIST",
@@ -97,8 +99,6 @@ interface ISpotEvent {
97
99
  url: string;
98
100
  }
99
101
  interface ISpot {
100
- clickUrl: string;
101
- impressionUrl: string;
102
102
  events: ISpotEvent[];
103
103
  spot: RMN_SPOT_TYPE;
104
104
  variant: SpotVariantType;
@@ -119,11 +119,16 @@ interface ISpot {
119
119
  productUpcs?: string[];
120
120
  env: RMN_ENV;
121
121
  }
122
+ interface ICreateSpotElementConfig {
123
+ fluid?: boolean;
124
+ customHtmlElement?: HTMLElement;
125
+ redirectOnClick?: boolean;
126
+ }
122
127
  type ISpots = Record<SpotIdentifierType, ISpot[]>;
123
128
 
124
129
  interface IRmnClient {
125
130
  spotSelection(data: ISpotSelectionParams): Promise<ISpots>;
126
- createSpotElement(spot: ISpot, fluid?: boolean): HTMLElement | null;
131
+ createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
127
132
  }
128
133
  interface IRmnConfig {
129
134
  env: RMN_ENV;
@@ -149,11 +154,14 @@ declare class LiquidCommerceRmnClient implements IRmnClient {
149
154
  * This method is useful when you are initializing the client in a browser environment, so you can create the spot html element directly from the RmnClient instance.
150
155
  *
151
156
  * @param {ISpot} spot - The spot data.
152
- * @param {boolean} fluid - If the spot should be fluid or not.
157
+ * @param {ICreateSpotElementConfig} config - The configuration object.
158
+ * @param {ICreateSpotElementConfig.fluid} config.fluid - If the spot should be fluid or not.
159
+ * @param {ICreateSpotElementConfig.customHtmlElement} config.customHtmlElement - Use a custom html element.
160
+ * @param {ICreateSpotElementConfig.redirectOnClick} config.redirectOnClick - If the spot should redirect on click.
153
161
  *
154
162
  * @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
155
163
  */
156
- createSpotElement(spot: ISpot, fluid?: boolean): HTMLElement | null;
164
+ createSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
157
165
  }
158
166
  /**
159
167
  * Creates a new instance of the RmnClient.
@@ -172,10 +180,13 @@ declare function RmnClient(apiKey: string, config: IRmnConfig): Promise<IRmnClie
172
180
  * Then you can use this function to create the spot html element based on the provided data without the need of the RmnClient instance.
173
181
  *
174
182
  * @param {ISpot} spot - The spot data.
175
- * @param {boolean} fluid - If the spot should be fluid or not.
183
+ * @param {ICreateSpotElementConfig} config - The configuration object.
184
+ * @param {ICreateSpotElementConfig.fluid} config.fluid - If the spot should be fluid or not.
185
+ * @param {ICreateSpotElementConfig.customHtmlElement} config.customHtmlElement - Use a custom html element.
186
+ * @param {ICreateSpotElementConfig.redirectOnClick} config.redirectOnClick - If the spot should redirect on click.
176
187
  *
177
188
  * @return {HTMLElement | null} - The spot html element or null if the browser environment is not available.
178
189
  */
179
- declare function RmnCreateSpotElement(spot: ISpot, fluid?: boolean): HTMLElement | null;
190
+ declare function RmnCreateSpotElement(spot: ISpot, config?: ICreateSpotElementConfig): HTMLElement | null;
180
191
 
181
- export { type IRmnClient, type IRmnConfig, type ISpot, type ISpotEvent, type ISpotSelectionParams, type ISpots, LiquidCommerceRmnClient, RMN_ENV, RMN_FILTER_PROPERTIES, RMN_SPOT_EVENT, RMN_SPOT_TYPE, RmnClient, RmnCreateSpotElement, type RmnFilterType, type RmnSpotType };
192
+ export { type ICreateSpotElementConfig, type IRmnClient, type IRmnConfig, type ISpot, type ISpotEvent, type ISpotSelectionParams, type ISpots, LiquidCommerceRmnClient, RMN_ENV, RMN_FILTER_PROPERTIES, RMN_SPOT_EVENT, RMN_SPOT_TYPE, RmnClient, RmnCreateSpotElement, type RmnFilterType, type RmnSpotType };