Skip to main content
Transport options control how the SDK sends events to Sentry, including buffering, headers, and custom endpoints.

BaseTransportOptions

From packages/core/src/types-hoist/transport.ts:

Options

url

string
required
The Sentry ingestion endpoint URL. Usually generated automatically from the DSN.

headers

Record<string, string>
Custom HTTP headers to include in requests.

bufferSize

number
default:"64"
Maximum number of requests to buffer before dropping events.From packages/core/src/transports/base.ts:
Example:

tunnel

string
Proxy endpoint for forwarding events. Useful for bypassing ad-blockers or CORS issues.

Buffer Management

The transport uses a promise buffer to manage concurrent requests:

Custom Transport

Create a custom transport implementation:

Tunnel Endpoint

Implement a tunnel endpoint to proxy events:

Server-Side Tunnel

Client Configuration

HTTP Client Options

For Node.js, additional HTTP options can be configured:

Offline Support

Implement offline queueing:

Multiplexed Transport

Send different event types to different DSNs:

Rate Limiting

The transport automatically handles rate limiting:

Request Retry

Implement custom retry logic:

Compression

Enable compression for smaller payloads:

Performance Monitoring

Monitor transport performance:

Best Practices

1. Set Appropriate Buffer Size

2. Use Tunnel for Browser Apps

3. Add Custom Headers for Authentication

4. Monitor Buffer Overflow