Skip to content

Commit 69e21b8

Browse files
Merge branch 'production' into marcio/pcx15594-mconn-self-serve
2 parents 6c3a7ff + 25675c2 commit 69e21b8

File tree

57 files changed

+1186
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1186
-427
lines changed

package-lock.json

Lines changed: 147 additions & 147 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"@astrojs/starlight": "0.34.3",
3636
"@astrojs/starlight-docsearch": "0.6.0",
3737
"@astrojs/starlight-tailwind": "4.0.1",
38-
"@cloudflare/vitest-pool-workers": "0.8.38",
38+
"@cloudflare/vitest-pool-workers": "0.8.45",
3939
"@cloudflare/workers-types": "4.20250620.0",
4040
"@codingheads/sticky-header": "1.0.2",
4141
"@expressive-code/plugin-collapsible-sections": "0.41.2",
@@ -54,7 +54,7 @@
5454
"@types/react": "19.0.7",
5555
"@types/react-dom": "19.0.4",
5656
"@typescript-eslint/parser": "8.34.1",
57-
"algoliasearch": "5.27.0",
57+
"algoliasearch": "5.29.0",
5858
"astro": "5.10.1",
5959
"astro-breadcrumbs": "3.3.1",
6060
"astro-icon": "1.1.5",
@@ -84,7 +84,7 @@
8484
"mdast-util-from-markdown": "2.0.2",
8585
"mdast-util-mdx": "3.0.0",
8686
"mdast-util-mdx-expression": "2.0.1",
87-
"mermaid": "11.6.0",
87+
"mermaid": "11.7.0",
8888
"micromark-extension-mdxjs": "3.0.0",
8989
"nanostores": "1.0.1",
9090
"node-html-parser": "7.0.1",

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@
503503
/cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/office365-email-security-mx/ /cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/microsoft365-email-security-mx/ 301
504504
/cloudflare-one/email-security/setup/post-delivery-deployment/api/office365-api/ /cloudflare-one/email-security/setup/post-delivery-deployment/api/m365-api/ 301
505505
/cloudflare-one/email-security/setup/post-delivery-deployment/bcc-journaling/journaling-setup/office365-journaling/ /cloudflare-one/email-security/setup/post-delivery-deployment/bcc-journaling/journaling-setup/m365-journaling/ 301
506+
/cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/microsoft365-email-security-mx/ /cloudflare-one/email-security/setup/pre-delivery-deployment/prerequisites/m365-email-security-mx/ 301
506507

507508
# firewall
508509
/firewall/api/cf-lists/ /waf/tools/lists/lists-api/ 301
-20.6 KB
Binary file not shown.
-175 KB
Binary file not shown.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Run AI-generated code on-demand with Code Sandboxes (new)
3+
description: You can start creating sandboxes today by installing our new Sandbox package.
4+
products:
5+
- agents
6+
- workers
7+
- workflows
8+
date: 2025-06-25T15:00:00Z
9+
---
10+
11+
AI is supercharging app development for everyone, but we need a safe way to run untrusted, LLM-written code. We’re introducing [Sandboxes](https://www.npmjs.com/package/@cloudflare/sandbox), which let your Worker run actual processes in a secure, container-based environment.
12+
13+
```ts
14+
import { getSandbox } from "@cloudflare/sandbox";
15+
export { Sandbox } from "@cloudflare/sandbox";
16+
17+
export default {
18+
async fetch(request: Request, env: Env) {
19+
const sandbox = getSandbox(env.Sandbox, "my-sandbox");
20+
return sandbox.exec("ls", ["-la"]);
21+
},
22+
};
23+
```
24+
25+
### Methods
26+
27+
- `exec(command: string, args: string[], options?: { stream?: boolean })`:Execute a command in the sandbox.
28+
- `gitCheckout(repoUrl: string, options: { branch?: string; targetDir?: string; stream?: boolean })`: Checkout a git repository in the sandbox.
29+
- `mkdir(path: string, options: { recursive?: boolean; stream?: boolean })`: Create a directory in the sandbox.
30+
- `writeFile(path: string, content: string, options: { encoding?: string; stream?: boolean })`: Write content to a file in the sandbox.
31+
- `readFile(path: string, options: { encoding?: string; stream?: boolean })`: Read content from a file in the sandbox.
32+
- `deleteFile(path: string, options?: { stream?: boolean })`: Delete a file from the sandbox.
33+
- `renameFile(oldPath: string, newPath: string, options?: { stream?: boolean })`: Rename a file in the sandbox.
34+
- `moveFile(sourcePath: string, destinationPath: string, options?: { stream?: boolean })`: Move a file from one location to another in the sandbox.
35+
- `ping()`: Ping the sandbox.
36+
37+
Sandboxes are still experimental. We're using them to explore how isolated, container-like workloads might scale on Cloudflare — and to help define the developer experience around them.
38+
39+
You can try it today from your Worker, with just a few lines of code. Let us know what you build.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Improved non-English keyboard support
3+
description: Introduced support for non-English keyboard configurations in the remote browser, enhancing the global user experience.
4+
date: 2024-11-21
5+
---
6+
7+
You can now type in languages that use diacritics (like á or ç) and character-based scripts (such as Chinese, Japanese, and Korean) directly within the remote browser. The isolated browser now properly recognizes non-English keyboard input, eliminating the need to copy and paste content from a local browser or device.

src/content/changelog/dns/2025-06-23-account-level-dns-analytics-api.mdx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ Authoritative DNS analytics are now available on the **account level** via the [
88

99
This allows users to query DNS analytics across multiple zones in their account, by using the `accounts` filter.
1010

11-
Here is an example to retrieve all DNS queries across all zones in an account that resulted in an `NXDOMAIN` response over a given time frame. Please replace `a30f822fcd7c401984bf85d8f2a5111c` with your actual account ID.
11+
Here is an example to retrieve the most recent DNS queries across all zones in your account that resulted in an `NXDOMAIN` response over a given time frame. Please replace `a30f822fcd7c401984bf85d8f2a5111c` with your actual account ID.
1212

1313
```graphql graphql-api-explorer title="GraphQL example for account-level DNS analytics"
14-
query Viewer {
15-
viewer {
16-
accounts(filter: { accountTag: "a30f822fcd7c401984bf85d8f2a5111c" }) {
17-
dnsAnalyticsAdaptive(
18-
limit: 10
19-
filter: { date_geq: "2025-06-16", responseCode: "NXDOMAIN", date_leq: "2025-06-18" }
20-
orderBy: [datetime_DESC]
21-
) {
22-
zoneTag
23-
queryName
24-
responseCode
25-
queryType
26-
datetime
27-
}
28-
}
29-
}
14+
query GetLatestNXDOMAINResponses {
15+
viewer {
16+
accounts(filter: { accountTag: "a30f822fcd7c401984bf85d8f2a5111c" }) {
17+
dnsAnalyticsAdaptive(
18+
filter: {
19+
date_geq: "2025-06-16",
20+
date_leq: "2025-06-18",
21+
responseCode: "NXDOMAIN"
22+
}
23+
limit: 10000
24+
orderBy: [datetime_DESC]
25+
) {
26+
zoneTag
27+
queryName
28+
responseCode
29+
queryType
30+
datetime
31+
}
32+
}
33+
}
3034
}
3135
```
3236

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "@cloudflare/actors library - SDK for Durable Objects in beta"
3+
description: "@cloudflare/actors library with Durable Objects helpers and patterns."
4+
products:
5+
- durable-objects
6+
- workers
7+
date: 2025-06-25T06:00:00Z
8+
---
9+
10+
The new [@cloudflare/actors](https://www.npmjs.com/package/@cloudflare/actors) library is now in beta!
11+
12+
The `@cloudflare/actors` library is a new SDK for Durable Objects and provides a powerful set of abstractions for building real-time, interactive, and multiplayer applications on top of Durable Objects. With beta uasge and feedback, `@cloudflare/actors` will become the recommended way to build on Durable Objects and draws upon Cloudflare's experience building products/features on Durable Objects.
13+
14+
The name "actors" originates from the [actor programming model](/durable-objects/what-are-durable-objects/#actor-programming-model), which closely ties to how Durable Objects are modelled.
15+
16+
The `@cloudflare/actors` library includes:
17+
18+
* Storage helpers for querying embeddeded, per-object SQLite storage
19+
* Storage helpers for managing SQL schema migrations
20+
* Alarm helpers for scheduling multiple alarms provided a date, delay in seconds, or cron expression
21+
* `Actor` class for using Durable Objects with a defined pattern
22+
* Durable Objects [Workers API](https://developers.cloudflare.com/durable-objects/api/base/) is always available for your application as needed
23+
24+
Storage and alarm helper methods can be combined with [any Javascript class](https://github.com/cloudflare/actors?tab=readme-ov-file#storage--alarms-with-durableobject-class) that defines your Durable Object, i.e, ones that extend `DurableObject` including the `Actor` class.
25+
26+
```js
27+
import { Storage } from "@cloudflare/actors/storage";
28+
29+
export class ChatRoom extends DurableObject<Env> {
30+
storage: Storage;
31+
32+
constructor(ctx: DurableObjectState, env: Env) {
33+
super(ctx, env)
34+
this.storage = new Storage(ctx.storage);
35+
this.storage.migrations = [{
36+
idMonotonicInc: 1,
37+
description: "Create users table",
38+
sql: "CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY)"
39+
}]
40+
}
41+
async fetch(request: Request): Promise<Response> {
42+
// Run migrations before executing SQL query
43+
await this.storage.runMigrations();
44+
45+
// Query with SQL template
46+
let userId = new URL(request.url).searchParams.get("userId");
47+
const query = this.storage.sql`SELECT * FROM users WHERE id = ${userId};`
48+
return new Response(`${JSON.stringify(query)}`);
49+
}
50+
}
51+
```
52+
53+
`@cloudflare/actors` library introduces the `Actor` class pattern. `Actor` lets you access Durable Objects without writing the Worker that communicates with your Durable Object (the Worker is created for you). By default, requests are routed to a Durable Object named "default".
54+
55+
```js
56+
export class MyActor extends Actor<Env> {
57+
async fetch(request: Request): Promise<Response> {
58+
return new Response('Hello, World!')
59+
}
60+
}
61+
62+
export default handler(MyActor);
63+
```
64+
65+
You can [route](/durable-objects/get-started/#3-instantiate-and-communicate-with-a-durable-object) to different Durable Objects by name within your `Actor` class using [`nameFromRequest`](https://github.com/cloudflare/actors?tab=readme-ov-file#actor-with-custom-name).
66+
67+
```js
68+
export class MyActor extends Actor<Env> {
69+
static nameFromRequest(request: Request): string {
70+
let url = new URL(request.url);
71+
return url.searchParams.get("userId") ?? "foo";
72+
}
73+
74+
async fetch(request: Request): Promise<Response> {
75+
return new Response(`Actor identifier (Durable Object name): ${this.identifier}`);
76+
}
77+
}
78+
79+
export default handler(MyActor);
80+
```
81+
82+
For more examples, check out the library [README](https://github.com/cloudflare/actors?tab=readme-ov-file#getting-started). `@cloudflare/actors` library is a place for more helpers and built-in patterns, like retry handling and Websocket-based applications, to reduce development overhead for common Durable Objects functionality. Please share feedback and what more you would like to see on our [Discord channel](https://discord.com/channels/595317990191398933/773219443911819284).

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

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,28 @@ sidebar:
77

88
import { Tabs, TabItem } from "~/components";
99

10-
The `/pdf` endpoint instructs the browser to render the webpage as a PDF document.
10+
The `/pdf` endpoint instructs the browser to generate a PDF of a webpage or custom HTML using Cloudflare's headless browser rendering service.
11+
12+
## Endpoint
13+
14+
```txt
15+
https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf
16+
```
17+
18+
## Required fields
19+
You must provide either `url` or `html`:
20+
- `url` (string)
21+
- `html` (string)
22+
23+
## Common use cases
24+
25+
- Capture a PDF of a webpage
26+
- Generate PDFs, such as invoices, licenses, reports, and certificates, directly from HTML
1127

1228
## Basic usage
1329

30+
### Convert a URL to PDF
31+
1432
<Tabs syncKey="workersExamples"> <TabItem label="curl">
1533

1634
Navigate to `https://example.com/` and inject custom CSS and an external stylesheet. Then return the rendered page as a PDF.
@@ -51,11 +69,35 @@ console.log(content);
5169

5270
</TabItem> </Tabs>
5371

72+
### Convert custom HTML to PDF
73+
74+
If you have raw HTML you want to generate a PDF from, use the `html` option. You can still apply custom styles using the `addStyleTag` parameter.
75+
76+
```bash
77+
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
78+
-H 'Authorization: Bearer <apiToken>' \
79+
-H 'Content-Type: application/json' \
80+
-d '{
81+
"html": "<html><body>Advanced Snapshot</body></html>",
82+
"addStyleTag": [
83+
{ "content": "body { font-family: Arial; }" },
84+
{ "url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" }
85+
]
86+
}' \
87+
--output "invoice.pdf"
88+
```
89+
5490
## Advanced usage
5591

56-
Navigate to `https://example.com`, first setting an additional HTTP request header and configuring the page size (`viewport`). Then, wait until there are no more than 2 network connections for at least 500 ms, or until the maximum timeout of 4500 ms is reached, before considering the page loaded and returning the rendered PDF document.
92+
:::note[Looking for more parameters?]
93+
Visit the [Browser Rendering PDF API reference](/api/resources/browser_rendering/subresources/pdf/methods/create/) for all available parameters, such as setting HTTP credentials using `authenticate`, setting `cookies`, and customizing load behavior using `gotoOptions`.
94+
:::
95+
96+
### Advanced page load with custom headers and viewport
5797

58-
The `goToOptions` parameter exposes most of [Puppeteer'd API](https://pptr.dev/api/puppeteer.gotooptions).
98+
Navigate to `https://example.com`, setting additional HTTP headers and configuring the page size (viewport). The PDF generation will wait until there are no more than two network connections for at least 500 ms, or until the maximum timeout of 4500 ms is reached, before rendering.
99+
100+
The `goToOptions` parameter exposes most of [Puppeteer's API](https://pptr.dev/api/puppeteer.gotooptions).
59101

60102
```bash
61103
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-rendering/pdf' \
@@ -78,9 +120,9 @@ curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<accountId>/browser-
78120
--output "advanced-output.pdf"
79121
```
80122

81-
## Blocking images and styles when generating a PDF
123+
### Blocking images and styles when generating a PDF
82124

83-
The options `rejectResourceTypes` and `rejectRequestPattern` can be used to block requests. The opposite can also be done, _only_ allow certain requests using `allowResourceTypes` and `allowRequestPattern`.
125+
The options `rejectResourceTypes` and `rejectRequestPattern` can be used to block requests during rendering. The opposite can also be done, _only_ allow certain requests using `allowResourceTypes` and `allowRequestPattern`.
84126

85127
```bash
86128
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
@@ -93,23 +135,3 @@ curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-
93135
}' \
94136
--output "cloudflare.pdf"
95137
```
96-
97-
## Generate PDF from custom HTML
98-
99-
If you have HTML you'd like to generate a PDF from, the `html` option can be used. The option `addStyleTag` can be used to add custom styles.
100-
101-
```bash
102-
curl -X POST https://api.cloudflare.com/client/v4/accounts/<acccountID>/browser-rendering/pdf \
103-
-H 'Authorization: Bearer <apiToken>' \
104-
-H 'Content-Type: application/json' \
105-
-d '{
106-
"html": "<html><body>Advanced Snapshot</body></html>",
107-
"addStyleTag": [
108-
{ "content": "body { font-family: Arial; }" },
109-
{ "url": "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" }
110-
]
111-
}' \
112-
--output "invoice.pdf"
113-
```
114-
115-
Many more options exist, like setting HTTP credentials using `authenticate`, setting `cookies`, and using `gotoOptions` to control page load behaviour - check the endpoint [reference](/api/resources/browser_rendering/subresources/pdf/methods/create/) for all available parameters.

0 commit comments

Comments
 (0)