Getting a CORS error
# support
c
Copy code
Access to fetch at 'https://api.vapi.ai/call/web' from origin 'https://*****.lambda-url.us-east-1.on.aws' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I have been using and testing our assistant with public keys for the last 2 weeks with no problems. Today I added some custom assistant properties
Copy code
vapiInstance = window.vapiSDK.run({
                    apiKey: apiKey,
                    assistant: assistantID,
                    config: buttonConfig,
                    assistantOverrides: {
                        name: 'Custom Assistant Name', // works
                        variableValues: {
                            "name": "John",
                        }
                });
It worked with assistantOverrides -> name But when I added assistantOverrides -> variableValues then it started the CORS errors. When I remove the code for assistantOverrides I still get the CORS errors. I am not sure how it could be related, but that is what I changed on my end. I have tried creating a new assistant and a new public-key with no access options and tried making one with my AWS Lambda function as the allowed access. Neither work any more, I get the above error Please help, this is quite urgent Chris
v
message has been deleted
c
Thank you, I have read through those posts and the answers did not solve my problem.
I also verified that your api did not change on https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js which is 1.1.7, I tried v1.1.6 and it also does not work with the CORS issue.
Did you guys make any changes? On the same script "unchanged", things seem to be working. Yesterday the CORS error disappeared and instead it was an error about bad public or private key and now I get no errors at all. 👍
21 Views