File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/content/docs/browser-rendering/rest-api Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,15 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
3636import Cloudflare from " cloudflare" ;
3737
3838const 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
4342const 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
4750console .log (screenshot .status );
You can’t perform that action at this time.
0 commit comments