SupabaseS
Supabase4y ago
Jan

Solved - Invoke edge function returning buffer-blob

Hi there,

I want to invoke an edge function that returns a buffer/blob of a created File. If I call the function via REST and save the output directly to a file it works great. But If I call the function with "supabase-js@2.0.0-rc.10" and trying to save the data-result the file is always corrupted. Any ideas what to do?

Example snippet:
supabase.functions.invoke<Blob>('createInvoice', {
      body: { invoiceId: invoiceId }
}).then(res => FileSaver.save(res.data))


Best regards,
Jan
Was this page helpful?