releasebird-javascript-sdk 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -186,6 +186,20 @@ export default class RbirdWebsiteWidget {
186
186
  }
187
187
  }
188
188
 
189
+ showButton(showButton) {
190
+ if (showButton) {
191
+ this.websiteWidget.style.display = 'block';
192
+ if (this.hideWidgetButton) {
193
+ this.hideWidgetButton.style.display = "block";
194
+ }
195
+ } else {
196
+ this.websiteWidget.style.display = 'none';
197
+ if (this.hideWidgetButton) {
198
+ this.hideWidgetButton.style.display = "none";
199
+ }
200
+ }
201
+ }
202
+
189
203
  closeWebsiteWidget() {
190
204
  if (this.iframe) {
191
205
  this.iframe.contentWindow?.postMessage({
package/src/index.js CHANGED
@@ -47,7 +47,15 @@ class Rbird {
47
47
  }
48
48
  }
49
49
 
50
+ static showButton(showButton) {
51
+ RbirdWebsiteWidget.getInstance().showButton(showButton);
52
+ }
53
+
50
54
  static initialize(apiKey) {
55
+ initialize(apiKey, true);
56
+ }
57
+
58
+ static initialize(apiKey, showButton) {
51
59
  try {
52
60
  const instance = this.getInstance();
53
61
  if (instance.initialized) {
@@ -56,6 +64,9 @@ class Rbird {
56
64
  }
57
65
  RbirdSessionManager.getInstance().init(apiKey);
58
66
  instance.initialized = true;
67
+ if (showButton) {
68
+ RbirdWebsiteWidget.getInstance().showButton(showButton);
69
+ }
59
70
  } catch (e) {
60
71
  console.error(e);
61
72
  }