1

I'm integrating Mesibo with React project created with CRA (Create React App). It would be very useful if const variables (flags) from JS SDK would be exported in some way. The way CRA works (I suppose due to webpack internal configuration) is that it doesn't bind variables from external js scripts to the global scope. So right now the only choice I think I have is to create my own file where I will copy all your const variables.

This is an improvement request, but also a question if anyone knows a better way to handle this right now :)

Create React App global variables: https://create-react-app.dev/docs/using-global-variables

JS Reference from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

Global constants do not become properties of the window object, unlike var variables.

contrl
  • 109
  • 1
  • 7
  • Mesibo does not use globals except from a few coming from rtc. Can you please share your implementation or the list of variables you are having issues with? – mesibo Feb 08 '21 at 14:27
  • @Mark thanks for your reply, what I'm having problem with is variables such as "MESIBO_STATUS_ONLINE" etc. (all consts defined at the end of mesibo.js) – contrl Feb 08 '21 at 15:20

0 Answers0