Skip to content

Commit c9e213c

Browse files
authored
Update pdf-endpoint.mdx
fix /pdf endpoint typescript example
1 parent f6ad7ef commit c9e213c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

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

5454
const client = new Cloudflare({
55-
apiEmail: process.env["CLOUDFLARE_EMAIL"], // This is the default and can be omitted
56-
apiKey: process.env["CLOUDFLARE_API_KEY"], // This is the default and can be omitted
55+
apiToken: process.env["CLOUDFLARE_API_TOKEN"],
5756
});
5857

5958
const pdf = await client.browserRendering.pdf.create({
60-
account_id: "account_id",
59+
account_id: process.env["CLOUDFLARE_ACCOUNT_ID"],
60+
url: "https://example.com/",
61+
addStyleTag: [
62+
{ content: "body { font-family: Arial; }" }
63+
]
6164
});
6265

6366
console.log(pdf);

0 commit comments

Comments
 (0)