Eliminate CORS in using inject.js script

I want to embed a chatbot in a website by pasting two lines of code.

For this, I have written a script.js that is hosted on

raw.githubusercontent.com/vikas70607/Botpress/main/Script.js

But this script is blocked by CORS as it is coming from an external source.
But others platform provides uses similar concept like


<script src="https://cdn.botpress.cloud/webchat/v1/inject.js"></script> 

and this works too.

Any help or Advice Regarding this.

I tried using only Vanilla JS, am I missing something? or should I be using node.