Add script tag to shopify store from shopify app

I would like to add script tag to a shopify store on one button click on shopify public app.
Based on the info have, I have implemented the logic but I am getting “[API] Invalid API key or access token (unrecognized login or wrong password)”