mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 08:03:46 +00:00
* remove website .astro * fix default origin * docs: comprehensive documentation overhaul - Add quickstart with multi-platform examples (E2B, Daytona, Docker, local) - Add environment variables setup with platform-specific tabs - Add Python SDK page (coming soon) - Add local deployment guide - Update E2B/Daytona/Docker guides with TypeScript examples - Configure OpenAPI auto-generation for API reference - Add CORS configuration guide - Update manage-sessions with Rivet Actors examples - Fix SDK method names and URLs throughout - Add icons to main documentation pages - Remove outdated universal-api and http-api pages * docs: add universal schema and agent compatibility docs - Create universal-schema.mdx with full event/item schema reference - Create agent-compatibility.mdx mirroring README feature matrix - Rename glossary.md to universal-schema.mdx - Update CLAUDE.md with sync requirements for new docs - Add links in README to building-chat-ui, manage-sessions, universal-schema - Fix CLI docs link (rivet.dev -> sandboxagent.dev) * docs: add inspector page and daytona network limits warning
60 lines
1.7 KiB
Text
60 lines
1.7 KiB
Text
---
|
|
title: "CORS Configuration"
|
|
description: "Configure CORS for browser-based applications."
|
|
sidebarTitle: "CORS"
|
|
icon: "globe"
|
|
---
|
|
|
|
When calling the Sandbox Agent server from a browser, you need to enable CORS (Cross-Origin Resource Sharing) explicitly.
|
|
|
|
## Basic Configuration
|
|
|
|
```bash
|
|
sandbox-agent server \
|
|
--token "$SANDBOX_TOKEN" \
|
|
--cors-allow-origin "http://localhost:5173" \
|
|
--cors-allow-method "GET" \
|
|
--cors-allow-method "POST" \
|
|
--cors-allow-header "Authorization" \
|
|
--cors-allow-header "Content-Type" \
|
|
--cors-allow-credentials
|
|
```
|
|
|
|
## Options
|
|
|
|
| Flag | Description |
|
|
|------|-------------|
|
|
| `--cors-allow-origin` | Origins allowed to make requests (e.g., `http://localhost:5173`) |
|
|
| `--cors-allow-method` | HTTP methods to allow (can be specified multiple times) |
|
|
| `--cors-allow-header` | Headers to allow (can be specified multiple times) |
|
|
| `--cors-allow-credentials` | Allow credentials (cookies, authorization headers) |
|
|
|
|
## Multiple Origins
|
|
|
|
You can allow multiple origins by specifying the flag multiple times:
|
|
|
|
```bash
|
|
sandbox-agent server \
|
|
--token "$SANDBOX_TOKEN" \
|
|
--cors-allow-origin "http://localhost:5173" \
|
|
--cors-allow-origin "http://localhost:3000" \
|
|
--cors-allow-method "GET" \
|
|
--cors-allow-method "POST" \
|
|
--cors-allow-header "Authorization" \
|
|
--cors-allow-header "Content-Type"
|
|
```
|
|
|
|
## Production
|
|
|
|
In production, replace `localhost` origins with your actual domain:
|
|
|
|
```bash
|
|
sandbox-agent server \
|
|
--token "$SANDBOX_TOKEN" \
|
|
--cors-allow-origin "https://your-app.com" \
|
|
--cors-allow-method "GET" \
|
|
--cors-allow-method "POST" \
|
|
--cors-allow-header "Authorization" \
|
|
--cors-allow-header "Content-Type" \
|
|
--cors-allow-credentials
|
|
```
|