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 @@ -46,12 +46,15 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
4646import Cloudflare from " cloudflare" ;
4747
4848const client = new Cloudflare ({
49- apiEmail: process .env [" CLOUDFLARE_EMAIL" ], // This is the default and can be omitted
50- apiKey: process .env [" CLOUDFLARE_API_KEY" ], // This is the default and can be omitted
49+ apiToken: process .env [" CLOUDFLARE_API_TOKEN" ],
5150});
5251
5352const snapshot = await client .browserRendering .snapshot .create ({
54- account_id: " account_id" ,
53+ account_id: process .env [" CLOUDFLARE_ACCOUNT_ID" ],
54+ url: " https://example.com/" ,
55+ addScriptTag: [
56+ { content: " document.body.innerHTML = \" Snapshot Page\" ;" }
57+ ]
5558});
5659
5760console .log (snapshot .content );
You can’t perform that action at this time.
0 commit comments