Skip to content

Commit 4b6b372

Browse files
committed
fix config title
1 parent 7416e63 commit 4b6b372

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

src/content/docs/agents/api-reference/configuration.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
2-
title:
2+
title: Configuration
33
pcx_content_type: concept
44
sidebar:
55
order: 3
6-
76
---
87

98
import { MetaInfo, Render, Type, WranglerConfig } from "~/components";

src/content/docs/agents/examples/browse-the-web.mdx

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,69 @@ sidebar:
77

88
import { MetaInfo, Render, Type, TypeScriptExample, WranglerConfig } from "~/components";
99

10-
TODO
10+
Agents can browse the web using the [Browser Rendering](/browser-rendering/) API or your preferred headless browser service.
11+
12+
### Browser Rendering API
13+
14+
The [Browser Rendering](/browser-rendering/) allows you to spin up headless browser instances, render web pages, and interact with websites through your Agent.
15+
16+
<TypeScriptExample>
17+
18+
```ts
19+
20+
21+
```
22+
23+
</TypeScriptExample>
24+
25+
You'll also need to add install the `@cloudflare/puppeteer` package and add the following to the wrangler configuration of your Agent:
26+
27+
```sh
28+
npm install @cloudflare/puppeteer --save-dev
29+
```
30+
31+
<WranglerConfig>
32+
33+
```jsonc title=
34+
"browser": {
35+
"binding": "MYBROWSER"
36+
},
37+
```
38+
39+
</WranglerConfig>
40+
41+
### Browserbase
42+
43+
You can also use [Browserbase](https://docs.browserbase.com/integrations/cloudflare/typescript) by using the Browserbase API directly from within your Agent.
44+
45+
Once you have your [Browserbase API key](https://docs.browserbase.com/integrations/cloudflare/typescript), you can add it to your Agent by creating a [secret](/workers/configuration/secrets/):
46+
47+
```sh
48+
cd your-agent-project-folder
49+
npx wrangler@latest secret put BROWSERBASE_API_KEY
50+
```
51+
```sh output
52+
Enter a secret value: … ******
53+
Creating the secret for the Worker "agents-example"
54+
Success! Uploaded secret BROWSERBASE_API_KEY
55+
```
56+
57+
Install the `@cloudflare/puppeteer` package and use it from within your Agent to call the Browserbase API:
58+
59+
```sh
60+
npm install @cloudflare/puppeteer
61+
```
62+
63+
<TypeScriptExample>
64+
65+
```ts
66+
interface Env {
67+
BROWSERBASE_API_KEY: string;
68+
}
69+
70+
export class MyAgent extends Agent<Env> {
71+
72+
}
73+
```
74+
75+
</TypeScriptExample>

0 commit comments

Comments
 (0)