Typeform/js-api-client

127.0.0.1/CORS access issue

Alex6534 opened this issue · 1 comments

Hey guys, trying to use the api wrapper locally but encountering a few issues. Stack is Flask + React. Error I'm getting is:

Uncaught (in promise) Error: Couldn't make requestAccess to XMLHttpRequest at 'https://api.typeform.com/forms' from origin 'http://127.0.0.1:3000' has been blocked by CORS policy

const typeformAPI = createClient({ token: "myToken" })

function getFormData() {
    typeformAPI.forms
    .list()
    .then(response => {
      console.log(response);
    })    
}


export default function TypeformQuickQuote() {
    
    return (
        <div>
            <h3>Typeform Quick Quote</h3>
            <div>{getFormData()}</div>
        </div>
    )
}

What am I missing here?

Hi @Alex6534
sorry I did not get your notification earlier.
Do you still have that issue?

We updated our CORS policy recently and we don't let such calls be made from the frontend directly.