Open wliumelb opened 1 month ago
Nice, it's hard for us to test all these different edge runtimes. I'll think about a better way to determine whether we require a proxy or not
Same problem with using Deno Deploy. I suggest reducing the number of checks for "stupid user" errors.
What is the current behavior?
Calling transcribeUrl api from deployed supabase edge function return CORS error:
Due to CORS we are unable to support REST-based API calls to our API from the browser. Please consider using a proxy, and including a
restProxy: { url: ''}
in your Deepgram client options.Steps to reproduce
run this function from deployed supabase edge function
Expected behavior
CORS error should not be triggered as it is not in a browser
Please tell us about your environment
Supabase edge runtime
Other information
The bug is caused by this line of code: https://github.com/deepgram/deepgram-js-sdk/blob/875650806ba46fc48adc817d44df48227771b2eb/src/lib/helpers.ts#L17
In the supabase edge run time, the 'window' global variable is an object rather than undefined