mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 07:04:48 +00:00
chore: simplify cloudflare compatibility (#191)
This commit is contained in:
parent
03e06e956d
commit
4201bd204b
10 changed files with 418 additions and 249 deletions
|
|
@ -39,6 +39,14 @@ const sdk = await SandboxAgent.connect({
|
|||
});
|
||||
```
|
||||
|
||||
With a custom fetch handler (for example, proxying requests inside Workers):
|
||||
|
||||
```ts
|
||||
const sdk = await SandboxAgent.connect({
|
||||
fetch: (input, init) => customFetch(input, init),
|
||||
});
|
||||
```
|
||||
|
||||
With persistence:
|
||||
|
||||
```ts
|
||||
|
|
@ -158,9 +166,10 @@ console.log(url);
|
|||
|
||||
Parameters:
|
||||
|
||||
- `baseUrl` (required): Sandbox Agent server URL
|
||||
- `baseUrl` (required unless `fetch` is provided): Sandbox Agent server URL
|
||||
- `token` (optional): Bearer token for authenticated servers
|
||||
- `headers` (optional): Additional request headers
|
||||
- `fetch` (optional): Custom fetch implementation used by SDK HTTP and ACP calls
|
||||
|
||||
## Types
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue