(url: string)
| 6 | // import Bytez from "../src/index.browser";; |
| 7 | |
| 8 | async function getDataUrl(url: string) { |
| 9 | const response = await fetch(url); |
| 10 | const blob = await response.blob(); |
| 11 | const buffer = await blob.arrayBuffer().then(Buffer.from); |
| 12 | |
| 13 | return `data:${blob.type};base64,${buffer.toString("base64")}`; |
| 14 | } |
| 15 | |
| 16 | const client = new Bytez(process.env.BYTEZ_KEY ?? "", true); |
| 17 |