gemini-api-node icon indicating copy to clipboard operation
gemini-api-node copied to clipboard

CORS issue when running in browser

Open jseils107 opened this issue 8 years ago • 2 comments

The API works great for my when running the js file directly in the console. However, when attempting to run via any browser, the private APIs are blocked by what appears to be a CORS issue. Any thoughts on bypassing this error in the browser?

jseils107 avatar Dec 19 '17 20:12 jseils107

You can set up your own proxy server that will send appropriate CORS headers (e.g. allow requests only from your website), and then direct requests to it.

E.g. see how I resolved the same issue for Cryptowatch API: https://github.com/wellsjo/cryptowatch-api/pull/4

burdakovd avatar Dec 27 '17 19:12 burdakovd

@burdakovd's solution is similar to something I've done myself, but we've come a long way in the last few years and there might be new ways of handling CORS. I'm refurbishing the package now and can look into it.

mjesuele avatar Aug 01 '20 16:08 mjesuele