Skip to main content
Transports control how the SDK sends events to Sentry. You can create custom transports to route events through proxies, add custom headers, implement retry logic, or integrate with custom infrastructure.

Transport Basics

A transport is responsible for sending envelopes (containing events, transactions, etc.) to Sentry:

Using Custom Transports

Built-in Transports

The SDK provides standard transports:

Browser

Node.js

Custom Transport Examples

Proxy Transport

Route events through a custom proxy:
Usage:

Batching Transport

Batch multiple envelopes together:

Logging Transport

Log events instead of sending them (useful for testing):

Fallback Transport

Try multiple endpoints with fallback:

Transport with Custom Headers

Add authentication or custom headers:
Usage:

Offline Transport

Queue events when offline:
Custom offline implementation:

Multiplexed Transport

Send to multiple Sentry projects:

Rate Limiting

Handle rate limits properly:

Testing Transports

Best Practices

Don’t let transport errors crash the app:
Honor Sentry’s rate limit headers:
Prevent hanging requests:
Retry failed requests with exponential backoff:

Complete Example

Usage:

Next Steps

Tunneling

Set up event tunneling through your backend

Custom Integrations

Build custom integrations