Skip to main content

My APIs using JavaScript fetch()

Comments

3 comments

  • Chris Coppenbarger

    I just tried it from a ngrok url, and it's also returning an "unauthorized" response.

    0
  • Scott Henderson CTO
    Answer Pro
    Top Contributor

    Invoking integrator.io APIs directly from a browser is currently unsupported (due to CORS).  This is a known enhancement request, but it is not trivial to expose this capability securely (i.e. where API tokens in the browser layer need to be secured, else limited in scope, etc...).

    The only way to work around the CORS issue right now is to call the integrator.io API directly from your backend servers.  This is not always possible of course, but hopefully this guidance can unblock you.

    0
  • Chris Coppenbarger

    Thanks Scott. I figured this was the case, since I have the same issue with Shopify and accessing their Admin API via the same Vue app. I'll see what I can do to make it work from a "backend" server. I'll probably just add a route via my Koa server I'm using to serve up the app in Shopify.

    0

Please sign in to leave a comment.