@superinterface/react 2.2.0 → 2.3.0

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.
package/dist/index.js CHANGED
@@ -2883,11 +2883,17 @@ var useMessageAudio = function(param) {
2883
2883
  latestMessageProps.latestMessage
2884
2884
  ]);
2885
2885
  });
2886
- audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?input=").concat(input2), {
2886
+ var searchParams = new URLSearchParams(_object_spread({
2887
+ input: input2
2888
+ }, isHtmlAudioSupported && superinterfaceContext.publicApiKey ? {
2889
+ publicApiKey: superinterfaceContext.publicApiKey
2890
+ } : {}));
2891
+ audioPlayer.load("".concat(superinterfaceContext.baseUrl, "/tts?").concat(searchParams), _object_spread({
2887
2892
  format: "mp3",
2888
2893
  autoplay: true,
2889
2894
  html5: isHtmlAudioSupported,
2890
- onend: onEnd,
2895
+ onend: onEnd
2896
+ }, isHtmlAudioSupported ? {} : {
2891
2897
  xhr: _object_spread_props(_object_spread({}, superinterfaceContext.publicApiKey ? {
2892
2898
  headers: {
2893
2899
  Authorization: "Bearer ".concat(superinterfaceContext.publicApiKey)
@@ -2895,7 +2901,7 @@ var useMessageAudio = function(param) {
2895
2901
  } : {}), {
2896
2902
  withCredentials: true
2897
2903
  })
2898
- });
2904
+ }));
2899
2905
  }, [
2900
2906
  superinterfaceContext,
2901
2907
  latestMessageProps,