Skip to content

Commit dfba25a

Browse files
authored
Update screenshot-endpoint.mdx
fix /screenshot typescript example
1 parent cbe448e commit dfba25a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/content/docs/browser-rendering/rest-api/screenshot-endpoint.mdx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
3636
import Cloudflare from "cloudflare";
3737

3838
const client = new Cloudflare({
39-
apiEmail: process.env["CLOUDFLARE_EMAIL"], // This is the default and can be omitted
40-
apiKey: process.env["CLOUDFLARE_API_KEY"], // This is the default and can be omitted
39+
apiToken: process.env["CLOUDFLARE_API_TOKEN"],
4140
});
4241

4342
const screenshot = await client.browserRendering.screenshot.create({
44-
account_id: "account_id",
43+
account_id: process.env["CLOUDFLARE_ACCOUNT_ID"],
44+
html: "Hello World!",
45+
screenshotOptions: {
46+
omitBackground: true,
47+
}
4548
});
4649

4750
console.log(screenshot.status);

0 commit comments

Comments
 (0)